21490 Posts in 5783 Topics by 2622 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1354 Views |
-
urlParams - more info

20 December 2009 at 11:24am
I see this bit of code being used in some places: $this->urlParams['']. I've seen an ID or an Action being passed with this, and you can pass something off to this by appending it to the url, such as: http://domain.com/Page/actionname. My questions are, how deep can this go? How does it know what I'm passing is an ID or some kind of action, or something else? Does it matter if I reverse the order up, like... domain.com/Page/actionname/ID or domain.com/Page/ID/actionname
Just looking for some light to be shed on this particular thing.
-
Re: urlParams - more info

20 December 2009 at 12:50pm Last edited: 20 December 2009 12:52pm
It's always Action/ID/OtherID.
This is defined as a "rewrite-rule" in sapphire/_config.phpDirector::addRules(1, array(
'$URLSegment//$Action/$ID/$OtherID' => 'ModelAsController',
));You can create your own rules if you need other syntax or more parameters.
Update: Action usually refers to a method on the controller. Eg. somepage/test calls the "test" method on the somepage controller
| 1354 Views | ||
|
Page:
1
|
Go to Top |


