Czy ktos sie orientuje jak za pomoca url helpera w pliku widoku wyswietlic tą trase:
<?php $translator = Zend_Registry::get('Zend_Translate'); Zend_Controller_Router_Route::setDefaultTranslator($translator); $locale = Zend_Registry::get('Zend_Locale'); $route = new Zend_Controller_Router_Route_Regex( ':lang/@nav-aktualnosci/(d+)-(.+).html', 'lang' => $locale->getLanguage(), 'module' => 'default', 'controller' => 'news', 'action' => 'view' ), 1 => 'id', 2 => 'description' ), ':lang/@nav-aktualnosci/%d-%s.html' ); $router->addRoute('news-view', $route); ?>
Z góry dziękuje za pomoc!
Problem rozwiązałem tworząc dwie oddzielne trasy i łącząc je w łańcuch:
<?php $routeN = new Zend_Controller_Router_Route( ':lang/@nav-aktualnosci', 'lang' => $locale->getLanguage(), 'module' => 'default', 'controller' => 'news', 'action' => 'index', ) ); $router->addRoute('news', $routeN); $routeR = new Zend_Controller_Router_Route_Regex( '(d+)-(.+).html', 1 => 'id', 2 => 'description' ), '%d-%s.html' ); $chainedRoute = new Zend_Controller_Router_Route_Chain(); $chainedRoute->chain($routeN) ->chain($routeR); $router->addRoute('chain', $chainedRoute); ?>
Wyswietlanie w pliku widoku: