Hi all,

I'm looking for the best way to match any of the following url's

domain.com/nl/inhoud/over-ons
domain.com/nl/inhoud/over-ons/kaart
--
domain.com/en/content/about-us
domain.com/en/content/about-us/map

I have created the following segments:

$nl = array(
   'lng'     => 'nl',
   'content' => 'inhoud',
);

$en = array(
   'lng'     => 'en',
   'content' => 'content',
);

$translator = new Zend_Translate('array', $nl, 'nl');
$translator->addTranslation($en, 'en');

$translator->setLocale('nl');
Zend_Controller_Router_Route::setDefaultTranslator($translator);

The problem I am having now is that I want to have anything after "content/*" or "inhoud/*" to match and passed as a parameter "url".
So far I have come up with the following:

$route = new Zend_Controller_Router_Route(
   '@lng/@content/:url',
   array(
       'controller' => 'index',
       'action'     => 'content',
       'url'         => null,
   )
);
$router->addRoute('content', $route);

This doesn't work, because ":url" will not match a slash, and thus a URL like "domain.com/en/content/about-us/map" will not work.

Is there any way you can combine a regex route with segments? Something like: $route = new Zend_Controller_Router_Route_Regex('@lng/@content/([a-zA-Z0-9-_./]*), ...);

Thanks in advance,


Andriesss








Gecontroleerd op virussen door de JOJO Secure Gateway.

Reply via email to