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.

Customising the CMS /

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

URL parameters: How to get 'Action'-parameter

Go to End

3 Posts   6766 Views


Community Member, 39 Posts

1 June 2010 at 5:40am

Edited: 01/06/2010 5:42am


I have a problem with URL parameters.

Here is my function in the page control:

function getAction() {
$URLParams = Director::URLParams();
$Action = $URLParams['Action'];
return $Action;

in my template I have next line: <p>Action = $getAction</p>

My URLs are and

I need $getAction to return value 'getNews1' in both cases.

Right now those URLs show me a message 'Sorry, it seems you were trying to access a page that doesn't exist. Please check the spelling of the URL you were trying to access and try again.'

I guess that CMS is trying to find a page with URl pageName1/getNews1 or pageName1/pageName2/getNews1.

It doesn't understand that 'getNews1' - is not a page, but it is a parameter 'action'

Please help!


Community Member, 56 Posts

3 June 2010 at 8:13pm

any luck? having a similiar problem..
wondering if I need to add something to director?


Forum Moderator, 435 Posts

8 June 2010 at 9:58am

A my example:

function order($request) {
echo Director::absoluteBaseURL();
echo "Order ID " . $request->param('ID');
echo "Ordine Inserito : ";

with print_r and echo you can read value.

And link checkpay/order/24/demovalue?flush=1