Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Pages: 1
Bonjour,
Je dispose d'un formulaire, et d'un traitement des données via un Zend_Filter_input.
J'ai donc déclaré mes filtres, validateurs, tout marche ![]()
Mais ....
Les messages personnalisés me posent probleme.
Voici la portion de code intéressante :
$validators = array(
'nom' => array('notEmpty',
'Alpha',
'messages' => array(
Zend_Validate_Alpha::NOT_ALPHA => $translate->_("Champ incorrect"),
Zend_Validate_Alpha::STRING_EMPTY => $translate->_("Votre nom est nécessaire")
)
),
'prenom' => array('notEmpty','Alpha'),
'email' => array('notEmpty','EmailAddress'),
'telephone' => 'StringLength'
);A priori, je ne vois rien ne problématique(je ne serais pas là sinon
)
Cependant, ca me renvoi ca :
Fatal error: Uncaught exception 'Zend_Validate_Exception' with message 'No message template exists for key 'notAlpha'' in E:\ged\www\ATESSIA\srouille\ZF version\library\Zend\Validate\Abstract.php:129 Stack trace: #0 E:\ged\www\ATESSIA\srouille\ZF version\library\Zend\Validate\Abstract.php(145): Zend_Validate_Abstract->setMessage('Champ incorrect', 'notAlpha') #1 E:\ged\www\ATESSIA\srouille\ZF version\library\Zend\Filter\Input.php(736)
...j'ai vérifié, les constantes NOT_ALPHA et STRING_EMPTY existe bien dans le Zend_Validate_Alpha...
Dernière modification par stf (28-04-2008 15:32:30)
Hors ligne
Vraiment Personne? ^^
Hors ligne
Ca ne marche pas non plus chez moi, je suis obligé de séparé comme ceci :
$validators = array(
'nom' => array('notEmpty',
'messages' => array(
Zend_Validate_Alpha::STRING_EMPTY => $translate->_("Votre nom est nécessaire") )
),
'nom' => array( 'Alpha',
'messages' => array(
Zend_Validate_Alpha::NOT_ALPHA => $translate->_("Champ incorrect"),
)
),As tu trouvé une solution ? (meme si ca date un peu )
Merci
Hors ligne
Réponse ici en fin de sujet : http://www.z-f.fr/forum/viewtopic.php?id=1275
Dernière modification par sebondus (29-05-2008 13:05:28)
Hors ligne
Pages: 1