Blogroll

Monday, April 16, 2012

Solved redirect with zend router

Redirect is the function in zend framework. But i hard to redirect on zend router config.
I have some error when use redirect to my router config.
Below solved problem
I define in ini file

routes.view_comment.type = "Zend_Controller_Router_Route_Regex"
routes.view_comment.route      = "comments/(.*)"
routes.view_comment.reverse = "comments/%s"
routes.view_comment.defaults.module    = "default"
routes.view_comment.defaults.controller= "comment"
routes.view_comment.defaults.action    = "list"
routes.view_comment.map.1     = "post_id"
In controller, I redirect to above router by this code :


$this->_redirect($this->view->url(array('post_id'=>$post_id),'view_comment'),array('prependBase' => false));

Note: rray('prependBase' => false) is require.
Olá! Se você ainda não assinou, assine nosso RSS feed e receba nossas atualizações por email, ou siga nos no Twitter.
Nome: Email:

0 comments:

Post a Comment