简体   繁体   中英

Routes on zend modules

I want to make a kind of alias for my modules: Is there a way to make

Or do I have to make a route for every single action I make in this module? If I don't make a route my links will look like:

http://www.example.com/news/news/show and http://www.example.com/news/news/show .

Ps i'm using Zend 1.10.6

Thanx in advance!

I guess it will be something like that:

$route = new Zend_Controller_Router_Route(
'news',
array('module' => 'news', 'controller' => 'news', 'action' => 'index'));
$router->addRoute('news', $route);

where first arg 'news' for Zend_Controller_Router_Route is the url http://www.example.com/news that will route to http://www.example.com/news/news/index

salu2

In your config file you must enable modules by putting this in your config file

resources.modules[] = 

And it should by default route correctly in your application.

您将必须为要以非标准方式路由的每个URL定义路由。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM