views:

39

answers:

1

I've set the following routes for in Zf:

$router->addRoute(
    'page',
    new Zend_Controller_Router_Route('stranka/:niceuri/:id', array('controller' => 'page', 'action' => 'index'))
);
$router->addRoute(
    'cat',
    new Zend_Controller_Router_Route('kategoria/:niceuri/:id', array('controller' => 'category', 'action' => 'index'))
);

The problem is that the 'cat' route keeps overwriting the other 'page' route and simle $this->url() routes aswell. That means, that any links using the 'page' route and having the param 'niceuri' defined have the the value of 'niceuri' equal to the currently open page using the 'cat' route - which they sholdn't have. (sorry, does that make sense to you?) Any ideas on how to solve this behavior? Thanks a lot.

A: 

I didn't exactly understand what did you mean, but... When you calling $this->uri helper in view you can set the name of the preffered router to use to assemble the url. Something like this:

echo $this->uri(array('niceuri' => 'Ololo', 'id' => '123'), 'page');

Hope this helps.

Ololo