zendscaffolding icon indicating copy to clipboard operation
zendscaffolding copied to clipboard

Redirect URL

Open akiiiii opened this issue 13 years ago • 0 comments

Hey lex0r,

first off thanx a lot for maintaining this class. Great work! :) I have one suggestion:

I had two problems. First I don't have modules. My module is 'default' and not included in the routing. So i had problems with this code:

$redirect = "{$this->view->module}/{$this->view->controller}/index";

I changed it to: ++++++++++++++ $redirect = $this->view->url(array( 'module' => $this->view->module, 'controller' => $this->view->controller, 'action' => 'index'), 'default'); ++++++++++++++ This way custom routes are considered and also the missing module in my case. I have a custom route called 'default'. ++++++++++++++ $router->addRoute('default', new Zend_Controller_Router_Route('/:controller/:action/:id', array( 'controller' => 'index', 'action' => 'index', 'id' => null, ))); ++++++++++++++ so:

$redirect = "{$this->view->module}/{$this->view->controller}/update/id/$insertId";

didn't work for me. But: ++++++++++++++ $redirect = $this->view->url(array( 'module' => $this->view->module, 'controller' => $this->view->controller, 'action' => 'update', 'id' => $insertId), 'default'); ++++++++++++++ Does. Would appreciate it if you could point it out if i missed something. Maybe adding the routeName to the $this->view->url() could also be made dynamic. Having to put the route name there is kinda awkward still. But maybe you find my addition useful.

Greetz, aki

akiiiii avatar Jan 13 '12 16:01 akiiiii