22853 Posts in 9936 Topics by 2804 members
|Go to End|
11 January 2011 at 2:13pm
12 January 2011 at 4:58am
First, you need to tell the controller class for your page that it is allowed to take parameters.
e.g. add this to the contrioller section:
static $allowed_actions = array(
...then you can access the parameters like this...
$action = Director::URLParam('action');
$page = Director::URLParam('ID');
$recsperpage = Director::URLParam('OtherID');
e.g. if you browse to...
...then using the above assignment code
$action is 'page'
$page is 5
$recsperpage is 50
Alternatively, use url handlers: http://doc.silverstripe.org/controller#url_handling
All this is ripe for a tutorial. I wonder if one exists.
12 January 2011 at 5:56am
|Go to Top|