Bonjour à tous,
J'ai un controlleur abstrait que voici :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?php
abstract class Custom_Controller_Action_Abstract extends Zend_Controller_Action
{
/**
* Helper method to redirect to a specific action or controller from a
* specific module, via a specified route(or not) with specified parameters
*
* @param string $controller / $url which contains http in its composition
* @param string $action
* @param string $module
* @param array $params
* @param string $route
* @param boolean $reset
*/
...
...
public function redirect($controller = 'index', $action = 'index', $module = 'frontoffice', $params = array(), $route = null, $reset = true )
{
$current_controller = $this->_getParam('controller');
$current_action = $this->_getParam('action');
$current_module = $this->_getParam('module');
....
....
return $this->_redirect->setCode(301)
->setExit(true)
->gotoSimpleAndExit($action,
$controller,
$module,
$params); |
Je l'appelle comme ceci (je me suis basé sur çà) , depuis mon loginController:
$this->_redirect($this->view->url(array(), $requestUri));
Je l'utilisais depuis pas mal de temps, et là, j'ai cette erreur :
Notice: Undefined property: LoginController::$_redirect in ...
et çà :
Fatal error: Call to a member function setCode() on a non-object in ...
1 2 3 4 5 6
| return $this->_redirect->setCode(301)
->setExit(true)
->gotoSimpleAndExit($action,
$controller,
$module,
$params); |
Pourquoi cela marchait avant ?
Je suis sur Ubuntu et Zend 1.12.0
Comment faire ? ou faire autrement svp ?
Merci
Fab
Partager