ZF2 Route Parameters

For programming and general questions on Zend Framework

ZF2 Route Parameters

Postby r0pk-h424t65gti-tst on Sat Jan 26, 2013 11:58 pm

Hi all,

I'm having issues setting up the route parameters for my ZF2 project. I want to be able to pass a URL as a parameter to the page, but each attempt to do so results in a 404.

I have created a URL module and would like to set it up so that the following URL passes in the encoded URL as the id param.

http://localhost/url/http%3A%2F%2Fwww%2 ... %2Eco%2Euk

Note: I've URL encoded the '.' character in the above example as the forum wouldn't let me submit the topic with a URL in; I'm not expecting the '.' character to be encoded.

The router section of my module.config.php looks like the below:

'router' => array(
'routes' => array(
'url' => array(
'type' => 'segment',
'options' => array(
'route' => '/url[/:id]',
'defaults' => array(
'controller' => 'URL\Controller\URL',
),
),
),
),
),

Any help would be much appreciated!

Cheers,

Mark
r0pk-h424t65gti-tst
 
Posts: 1
Joined: Sat Jan 26, 2013 11:49 pm

Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 10 guests