lex0r/zendscaffolding — Issue #3: Redirect URL 
Author: akiiiii
Created: 2012-01-13 16:08:42+00:00
State: open

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