Re: [fw-general] router question - how to hide default module, controller and action in url?
ok now I created: $router->addRoute( 'url', new Zend_Controller_Router_Route(':lang/:module/:category/:controller/:action/:test', array('module'=>'default', 'controller' => 'index', 'action' => 'index', 'lang' => 'en', 'category'=> 'categ1', 'test'=>'somevalue')) ); but the problem remains. For example i write: http://domain/there_should_be_category/ and result is: ["_params:protected"] => array(6) { ["lang"] => string(24) "there_should_be_category" ["module"] => string(7) "default" ["controller"] => string(5) "index" ["action"] => string(5) "index" ["category"] => string(6) "categ1" ["test"] => string(9) "somevalue" } or url:http://domain/en/there_should_be_category/there_should_be_test_value result: "_params:protected"] => array(6) { ["lang"] => string(2) "en" ["module"] => string(24) "there_should_be_category" ["category"] => string(26) "there_should_be_test_value" ["controller"] => string(5) "index" ["action"] => string(5) "index" ["test"] => string(9) "somevalue" } I don't want everytime in my url include default language parameter and same with default model, controllers and action. -- View this message in context: http://www.nabble.com/router-question---how-to-hide-default-module%2C-controller-and-action-in-url--tp14948082s16154p14993974.html Sent from the Zend Framework mailing list archive at Nabble.com.
[fw-general] router question - how to hide default module, controller and action in url?
I created router $router = $frontController->getRouter(); $router->addRoute( 'url', new Zend_Controller_Router_Route(':lang/:module/:category/:controller/:action/:test', array('module'=>'default', 'controller' => 'index', 'action' => 'index', 'lang' => 'en', 'category'=> 'categ1')) ); when url is [url]http://domain/en/default/pc/index/index/something/[/url] everything works fine. $this->getRequest(); output in Controller is ["_params:protected"] => array(6) { ["lang"] => string(2) "en" ["module"] => string(7) "default" ["category"] => string(2) "pc" ["controller"] => string(5) "index" ["action"] => string(5) "index" ["test"] => string(9) "something" } Problem occurs when I change url, for example remove default index controller and action [url]http://domain/en/default/pc/something/[/url] error is: Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (en)' in C:\wamp\www\ZendFramework-1.0.3\library\Zend\Controller\Dispatcher\Standard.php:198 ... What should I change in router definition if I want that results of these urls: [url]http://domain/en/default/pc/index/index/something/[/url] [url]http://domain/en/pc/index/index/something/[/url] [url]http://domain/en/pc/index/something/[/url] [url]http://domain/en/pc/something/[/url] [url]http://domain/pc/something/[/url] be the same?: ["_params:protected"] => array(6) { ["lang"] => string(2) "en" ["module"] => string(7) "default" ["category"] => string(2) "pc" ["controller"] => string(5) "index" ["action"] => string(5) "index" ["test"] => string(9) "something" } -- View this message in context: http://www.nabble.com/router-question---how-to-hide-default-module%2C-controller-and-action-in-url--tp14948082s16154p14948082.html Sent from the Zend Framework mailing list archive at Nabble.com.