Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Voilà ce que j'ai eu :
An error occurred
Page not found
Exception information:
Message: Action "indexPhtml" does not exist and was not trapped in __call() Stack trace: #0 /usr/share/php/libzend-framework-php/Zend/Controller/Action.php(515): Zend_Controller_Action->__call('indexPhtmlActio...', Array) #1 /usr/share/php/libzend-framework-php/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('indexPhtmlActio...') #2 /usr/share/php/libzend-framework-php/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #3 /usr/share/php/libzend-framework-php/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() #4 /usr/share/php/libzend-framework-php/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() #5 /opt/lampp/htdocs/xampp/test/public/index.php(30): Zend_Application->run() #6 {main} Request Parameters: array ( 'controller' => 'auth', 'action' => 'index.phtml', 'module' => 'default', )
Hors ligne
Ton action indexPhtml, renomme la en index et ça devrait être largement mieux.
Hors ligne
A savoir : lorsque l'on utilise un nom de méthode en lowerCamelCase pour une action, type indexPhtmlAction(), elle doit être appelée par la chaîne en remplaçant les majuscules par des -.
UserSubscriptionAction => user-subscription
TrucDeFouAction => truc-de-fou
Hors ligne
Théocrite a écrit:
A savoir : lorsque l'on utilise un nom de méthode en lowerCamelCase pour une action, type indexPhtmlAction(), elle doit être appelée par la chaîne en remplaçant les majuscules par des -.
UserSubscriptionAction => user-subscription
TrucDeFouAction => truc-de-fou
Pour l'indexAction , index est en miniscule .
Par contre lorsque je fais http://localhost/xampp/test/public/auth/ j'obtiens ceci :
Warning: include_once(Application/Form/Login.php) [function.include-once]: failed to open stream: Aucun fichier ou dossier de ce type in /opt/lampp/htdocs/xampp/test/library/Zend/Loader.php on line 146
Warning: include_once() [function.include]: Failed opening 'Application/Form/Login.php' for inclusion (include_path='/opt/lampp/htdocs/xampp/test/application/../library:/opt/lampp/htdocs/xampp/test/library:.:/usr/share/php/libzend-framework-php') in /opt/lampp/htdocs/xampp/test/library/Zend/Loader.php on line 146
Fatal error: Class 'Application_Form_Login' not found in /opt/lampp/htdocs/xampp/test/application/controllers/AuthController.php on line 6
Dernière modification par inzaghi (25-02-2012 03:05:19)
Hors ligne
Comment utilises-tu l'auto-loading ?
Peux-tu nous montrer ton index.php et nous spécifier ton arborescence (notamment où se trouve ton formulaire de login et comment se nomme ta classe) ?
Hors ligne
r.monceau a écrit:
Comment utilises-tu l'auto-loading ?
Peux-tu nous montrer ton index.php et nous spécifier ton arborescence (notamment où se trouve ton formulaire de login et comment se nomme ta classe) ?
test / application / Form / Login.php
<?php class Application_Form_Login extends Zend_Form { public function init() { $this->setName("login"); $this->setMethod('post'); $this->addElement('text', 'username', array( 'filters' => array('StringTrim', 'StringToLower'), 'validators' => array( array('StringLength', false, array(0, 50)), ), 'required' => true, 'label' => 'Username:', )); $this->addElement('password', 'password', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 50)), ), 'required' => true, 'label' => 'Password:', )); $this->addElement('submit', 'login', array( 'required' => false, 'ignore' => true, 'label' => 'Login', )); } }
test / application / controllers / AuthController.php
test / application / views / scripts / auth / index.phtml
test / application / models / DbTable / Users.php
Hors ligne
Appelle ton répertoire forms. Ça devrait fonctionner si tu utilises l'auto-loader tel qu'il est configuré par défaut.
Hors ligne
r.monceau a écrit:
Appelle ton répertoire forms. Ça devrait fonctionner si tu utilises l'auto-loader tel qu'il est configuré par défaut.
oui je l'ai modifié mais toujours la même erreur
Hors ligne
J'ai dû mal à comprendre ton arborescence en fait. Il y a pas mal de choses qui m'échappent là.
Je vais plutôt te filer un lien te permettant de mettre en place les TU : http://www.slideshare.net/mikaelkael/te … rk-5155326
++
Hors ligne
r.monceau a écrit:
J'ai dû mal à comprendre ton arborescence en fait. Il y a pas mal de choses qui m'échappent là.
Je vais plutôt te filer un lien te permettant de mettre en place les TU : http://www.slideshare.net/mikaelkael/te … rk-5155326
++
Si tu en as un exemple que tu as fait et qui fonctionne correctement ça m'aidera . j'ai essayé tout sur internet mais rien .
Hors ligne
Pages: 1