Skip to content

Commit 4a213e4

Browse files
committed
Bugfix
1 parent 46fdb93 commit 4a213e4

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

example/index.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@
2525
// regular expressions determine what is valid for 'filename' and 'ext'
2626
array("filename"=>'[\w\d_-]+', "ext"=>"(txt|json)"));
2727

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+
2837
// generic mapping for http://<location>/example/<controller>/<action>
2938
// -> for example http://<location>/example/person/all will run
3039
// PersonController->all()
3140
// -> or http://<location>/example/organisation/add will run
3241
// OrganisationController->add()
3342
$r->map(":controller/:action");
3443

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-
4444
$r->run();
4545

4646

@@ -63,7 +63,7 @@ public function overview() {
6363
"some-filename.xml",
6464
"person/2",
6565
"person/all",
66-
"organisation/github",
66+
"organisation/5",
6767
"organisation/add",
6868
"image.jpg", // it won't interfere with getting existing external files
6969
);

0 commit comments

Comments
 (0)