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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

SS 3.01 Director::urlParam


Go to End


4 Posts   2504 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, 5523 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
JonShutt

Community Member, 244 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()