Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

SS 3.01 Director::urlParam


Reply


4 Posts   919 Views

Avatar
Pike

Community Member, 42 Posts

10 August 2012 at 1:24am

Hi,

from SS verzion 3.0 this is deprecated:
$action = Director::urlParam( 'Action' );

How can I can get param when I want it from module?

Avatar
Willr

Forum Moderator, 5513 Posts

12 August 2012 at 12:34pm

From the controller you can use $this->getAction(). If you want the action name from outside the controller you first have to get the current controller:

$curr = Controller::curr();
$curr->getAction()

Avatar
Futureweb

Community Member, 233 Posts

26 August 2012 at 10:27pm

not sure which was is recommended, but i've been using

$Params = $this->getURLParams();

which gives:

$Params['Action']
$Params['ID']
$Params['OtherID']

Avatar
Pike

Community Member, 42 Posts

26 August 2012 at 10:53pm

Edited: 26/08/2012 11:06pm

No, $Params = $this->getURLParams(); cannot be used.
Error: Call to undefined method CompactNavigator::getULRParams()