Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour,
J'essaie de créer un formulaire en utilisant Zend_Form.
Dans IndexController.php :
public function tournoiAction() { $this->view->title = ""; // création d'une instance du formulaire $form = new Inscription(array( 'action' => $this->view->url(array('action' => 'tournoi')), 'method' => 'post' )); // vérification de la validité des données if ($this->_request->isPost() && $form->isValid($this->_request->getPost())) { ...
C'est l'appel de new Inscription(
qui me génère l'erreur suivante :
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\xampp\htdocs\ZF_ECC_Public\library\Zend\Controller\Dispatcher\Standard.php:241 Stack trace: #0 C:\xampp\htdocs\ZF_ECC_Public\library\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 C:\xampp\htdocs\ZF_ECC_Public\application\Bootstrap.php(17): Zend_Controller_Front->dispatch() #2 C:\xampp\htdocs\ZF_ECC_Public\index.php(18): Bootstrap::run() #3 {main} thrown in C:\xampp\htdocs\ZF_ECC_Public\library\Zend\Controller\Dispatcher\Standard.php on line 241
J'ai créé un répertoire /application/forms. La classe Inscription.php est dans ce répertoire.
et dans le fichier index.php, j'ai défini ce répertoire dans le include path:
set_include_path(
$root . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'models' . PATH_SEPARATOR
. $root . DIRECTORY_SEPARATOR . 'application' . DIRECTORY_SEPARATOR . 'forms' . PATH_SEPARATOR
. $root . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
. get_include_path()
);
Dernière modification par GregLeBarbar (26-05-2009 15:46:16)
Hors ligne
Apparemment, ton code génère une exception et tu n'as pas de contrôleur d'erreur. Essaie de désactiver le plugin de gestion des erreurs avec Zend_Controller_Front::getInstance()->throwExceptions(true); dans ton bootstrap, tu auras ainsi le détail de l'exception.
Dernière modification par mdelanno (23-05-2009 19:22:07)
Hors ligne
Merci beaucoup mdelanno !
En effet, je n'avais pas compris le message d'erreur. J'ai effectué la modification que tu as proposé et j'ai obtenu un message d'erreur parlant et pu corrigé le problème.
Merci encore !
Hors ligne
Pages: 1