Simple rewrites in Zend Framework

Answer

for a defined purpose like you have a "named" route would be the simplest way to do it. While there are any number of ways to implement a named route the easiest is to put it in the application.ini:

// /application/configs/application.ini
    resources.router.routes.login.route =/login
    resources.router.routes.login.defaults.module=default
    resources.router.routes.login.defaults.controller = auth
    resources.router.routes.login.defaults.action = login

putting it in your bootstrap is not wrong, it just doesn't seem as convienient to me.
Also doing it this way should (no guarantees) prevent any problems with the default routes.

When calling a route using the url() helper it is important to remember to use either the named route :

<?php echo $this->url(array(),'routeName')?>

or if you need to pass the normal 'controller' => , 'action' => :

<?php echo $this->url(array('controller'=>'index','action'=>'index'),'default')?>

All zend-framework Questions

Ask your interview questions on zend-framework

Write Your comment or Questions if you want the answers on zend-framework from zend-framework Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---