|
Publicité ' | |||||||||||||||||||||||
|
|
#1 | ||
|
Membre habitué
![]() Inscription : septembre 2007 Messages : 357 ![]() |
Bonjour,
Lorsque je tappe une url qui n'existe pas (ex: monsite/controlleur/nimportequoi) Zend me génère une exception de ce type : Code :
Fatal error: Uncaught exception 'Zend_Controller_Action_Exception' with message 'IndexController::errdsqfAction() does not exist and was not trapped in __call()' in C:\wamp\www\mytranspole\library\zend\Controller\Action.php:480 Stack trace: #0 [internal function]: Zend_Controller_Action->__call('errdsqfAction', Array) #1 C:\wamp\www\mytranspole\library\zend\Controller\Action.php(497): IndexController->errdsqfAction() #2 C:\wamp\www\mytranspole\library\zend\Controller\Dispatcher\Standard.php(238): Zend_Controller_Action->dispatch('errdsqfAction') #3 C:\wamp\www\mytranspole\library\zend\Controller\Front.php(920): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #4 C:\wamp\www\mytranspole\index.php(43): Zend_Controller_Front->dispatch() #5 {main} thrown in C:\wamp\www\mytranspole\library\zend\Controller\Action.php on line 480 Code :
$frontController->throwExceptions(true); Code :
$frontController->throwExceptions(false); Code :
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\wamp\www\mytranspole\library\zend\Controller\Dispatcher\Standard.php:194 Stack trace: #0 C:\wamp\www\mytranspole\library\zend\Controller\Front.php(920): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\wamp\www\mytranspole\index.php(43): Zend_Controller_Front->dispatch() #2 {main} thrown in C:\wamp\www\mytranspole\library\zend\Controller\Dispatcher\Standard.php on line 194 2. Je souhaiterai que lorsque le controlleur ou l'action n'existe pas, j'ai une redirection vers une page type "erreur 404 page non trouvé" ou bien vers la page principal du site. C'est possible ? 3. Ou est indiqué dans le fichier principal index.php que le fichier index à ouvrir par défaut est bien /monsite/Index ? Je suis mon premier tutorial (qui fonctionne) mais je ne vois pas ou est indiquer que par défaut il faut ouvrir index/ comme Controlleur. Est-il possible d'indiquer un autre Controlleur par défaut en guise de page d'accueil ? Voici le code que je pense être chargé d'afficher le controlleur par défaut index : Code :
|
||
|
|
00
|
|
|
#2 |
|
Nouveau Membre du Club
![]() Inscription : mars 2003 Messages : 31 ![]() |
Je me pose aussi la même question et je crois avoir trouvé un début de réponse...
Il faut créer un controlleur nommé "ErrorController" avec dedant la méthode "errorAction" et virer la ligne $front->throwExceptions(). Normalement les erreurs seront redirigées vers errorAction()... |
|
|
00
|
Copyright © 2000-2012 - www.developpez.com