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   796 Views

Avatar
Pike

10 August 2012 at 1:24am Community Member, 40 Posts

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

12 August 2012 at 12:34pm Forum Moderator, 5511 Posts

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

26 August 2012 at 10:27pm Community Member, 233 Posts

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

$Params = $this->getURLParams();

which gives:

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

Avatar
Pike

26 August 2012 at 10:53pm (Last edited: 26 August 2012 11:06pm), Community Member, 40 Posts

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