22976 Posts in 11493 Topics by 2824 members
|Go to End|
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.
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.php
'$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
|Go to Top|