25
25
// regular expressions determine what is valid for 'filename' and 'ext'
26
26
array ("filename " =>'[\w\d_-]+ ' , "ext " =>"(txt|json) " ));
27
27
28
+ // generic mapping for http://<location>/example/<controller>/<id>
29
+ // -> for example http://<location>/example/person/2 will run
30
+ // PersonController->view(2)
31
+ // -> or http://<location>/example/organisation/3 will run
32
+ // OrganisationController->view(3)
33
+ $ r ->map (":controller/:id " ,
34
+ array ('action ' =>'view ' ),
35
+ array ("id " =>"[0-9]+ " )); // only allow numeric values for 'id'
36
+
28
37
// generic mapping for http://<location>/example/<controller>/<action>
29
38
// -> for example http://<location>/example/person/all will run
30
39
// PersonController->all()
31
40
// -> or http://<location>/example/organisation/add will run
32
41
// OrganisationController->add()
33
42
$ r ->map (":controller/:action " );
34
43
35
- // generic mapping for http://<location>/example/<controller>/<id>
36
- // -> for example http://<location>/example/person/2 will run
37
- // PersonController->view(2)
38
- // -> or http://<location>/example/organisation/3 will run
39
- // OrganisationController->view(3)
40
- $ r ->map (":controller/:id " ,
41
- array ('action ' =>'view ' ),
42
- array ("id " =>"[0-9]+ " )); // only allow numeric values for 'id'
43
-
44
44
$ r ->run ();
45
45
46
46
@@ -63,7 +63,7 @@ public function overview() {
63
63
"some-filename.xml " ,
64
64
"person/2 " ,
65
65
"person/all " ,
66
- "organisation/github " ,
66
+ "organisation/5 " ,
67
67
"organisation/add " ,
68
68
"image.jpg " , // it won't interfere with getting existing external files
69
69
);
0 commit comments