Salut,
Je suis entrain d'utiliser Zend Framework 0.2.0 et j'ai un problème de redirection. Dans mon indexController dans la méthode noRoute j'ai cette ligne de code:Le problème est quand je tappe http://localhost/controlleur_inexistant
Code : Sélectionner tout - Visualiser dans une fenêtre à part $this->_redirect('/');
il m'affiche le message d'erreur ci-dessous:
au lieu de me rediriger vers http://localhost
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Fatal error: Uncaught exception 'Zend_Controller_Action_Exception' with message 'Cannot redirect because headers have already been sent.' in C:\wamp\lib\Zend\Controller\Action.php:192 Stack trace: #0 C:\wamp\app\controllers\IndexController.php(18): Zend_Controller_Action->_redirect('/') #1 C:\wamp\lib\Zend\Controller\Action.php(118): IndexController->noRouteAction() #2 C:\wamp\lib\Zend\Controller\Dispatcher.php(185): Zend_Controller_Action->run(Object(Zend_Controller_Dispatcher), Object(Zend_Controller_Dispatcher_Token)) #3 C:\wamp\lib\Zend\Controller\Dispatcher.php(136): Zend_Controller_Dispatcher->_dispatch(Object(Zend_Controller_Dispatcher_Token), true) #4 C:\wamp\lib\Zend\Controller\Front.php(254): Zend_Controller_Dispatcher->dispatch(Object(Zend_Controller_Dispatcher_Token)) #5 C:\wamp\www\index.php(22): Zend_Controller_Front->dispatch() #6 {main} thrown in C:\wamp\lib\Zend\Controller\Action.php on line 192
Est ce que vous avez une idée?
Merci
Cordialement Verboz
Partager