21307 Posts in 5737 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » Director::URLParam() seems to give me wrong values...
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 816 Views |
-
Director::URLParam() seems to give me wrong values...

26 September 2011 at 9:48am
Hello,
my url is mysite.com/category/subpage/shownote/1
Director::URLParam('Action') is giving me the value 'subpage' and
Director::URLParam('ID') is giving me the value 'shownote'I'm expecting action to equal shownote, and ID to equal 1.
what am I doing wrong here?
Thanks!
-
Re: Director::URLParam() seems to give me wrong values...

26 September 2011 at 12:29pm
Director::urlParam() is deprecated and doesn't work properly any more - instead you should use $this->request->param() inside your controller.
-
Re: Director::URLParam() seems to give me wrong values...

26 September 2011 at 12:50pm
Hi ajshort - thanks for that. now works perfectly...
-
Re: Director::URLParam() seems to give me wrong values...

22 September 2012 at 12:34am Last edited: 22 September 2012 12:35am
Perfect, this solved the issue for me.
e.g.
$id = $this->request->param('ID');
rather than
$id = Director::URLParam('ID');
Cheers,
HARVS
-
Re: Director::URLParam() seems to give me wrong values...

11 February 2013 at 6:46pm
In case, I want to get ID param not inside of a controller. How can I do it without Director::urlParam('ID')?
-
Re: Director::URLParam() seems to give me wrong values...

11 February 2013 at 6:48pm
Controller::curr()->getRequest()->param('ID');
| 816 Views | ||
|
Page:
1
|
Go to Top |



