21492 Posts in 5783 Topics by 2621 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 342 Views |
-
SS3 urlParam change question

5 December 2012 at 3:43am
if i was previously saying
if ( Director::urlParam("OtherID") ) {
what does this become in SS3?
HTTP_Request::??
-
Re: SS3 urlParam change question

5 December 2012 at 1:28pm
When I use
$MyRequesParamvar = Director::urlParam("OtherID"); in ss2.* works fine.In silver stripe 3 I get an error saying Director:urlParam is depreciated.
So I'm not sure how I use the http_request ?
what does the above become in Silverstripe 3?
-
Re: SS3 urlParam change question

5 December 2012 at 2:13pm
Sorry, missed that dep note.
Try:
$this->request->getVar('OtherID');
-
Re: SS3 urlParam change question

5 December 2012 at 3:11pm
Assuming you're in a controller, it becomes $this->request->param('OtherID'). Otherwise, Controller::curr()->getRequest()->param('OtherID').
-
Re: SS3 urlParam change question

6 December 2012 at 12:36am
many thanks
Both of those worked for me
i used $this->request->param('OtherID');
| 342 Views | ||
|
Page:
1
|
Go to Top |


