Routing: Module alias

For programming and general questions on Zend Framework

Routing: Module alias

Postby reinierkip on Fri Sep 02, 2011 3:50 pm

What is the best way to create a "module alias"? I'd like to map `/my-module-alias/controller/action` to `/module/controller/action`, and vice versa (when assembling URLs for a specific module/controller/action), where `my-module-alias` can be any valid name I configure. All other routes still behave as "normal" (using Zend_Controller_Router_Route_Module).

Examples:
- `/alias1/index/index` maps to the aliased module users, controller index, action index.
- `/archive/index/index` just maps to module archive, controller index, action index.
- `$route->assemble(array('module' => 'users', 'controller' => 'index', action => 'index'));` would return `/alias1/index/index`

Reinier
reinierkip
 
Posts: 1
Joined: Fri Sep 02, 2011 3:35 pm

Re: Routing: Module alias

Postby inri13666 on Wed Dec 26, 2012 12:21 pm

+1
inri13666
 
Posts: 1
Joined: Wed Dec 26, 2012 12:20 pm


Return to Zend Framework

Who is online

Users browsing this forum: Google [Bot] and 7 guests