Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class RegisterForm extends Zend_Form {
- public function __construct($options = null) {
- parent::__construct($options);
- $config = new Zend_Config_Ini('../application/configs/application.ini', 'production');
- $nom = $this->addElement('text', 'nom', array(
- 'filters' => array('StringTrim', 'StringToLower'),
- 'validators' => array(
- 'Alpha',
- array('StringLength', false, array(3, 20)),
- ),
- 'required' => true,
- 'label' => 'Nom :',
- ));
- $prenom = $this->addElement('text', 'prenom', array(
- 'filters' => array('StringTrim', 'StringToLower'),
- 'validators' => array(
- 'Alpha',
- array('StringLength', false, array(3, 20)),
- ),
- 'required' => true,
- 'label' => 'Prénom :'
- ));
- $email = $this->addElement('text', 'email', array(
- 'filters' => array('StringTrim', 'StringToLower'),
- 'validators' => array(
- 'Alnum',
- array('StringLength', false, array(6, 20)),
- ),
- 'required' => true,
- 'label' => 'Adresse e-mail :'
- ));
- $password = $this->addElement('password', 'password', array(
- 'filters' => array('StringTrim'),
- 'validators' => array(
- 'Alnum',
- array('StringLength', false, array(6, 20)),
- ),
- 'required' => true,
- 'label' => 'Mot de passe :'
- ));
- $this->addDisplayGroup(array('nom', 'prenom', 'email', 'password'), 'name', array(
- 'legend' => 'Coucou',
- ));
- $captcha = new Zend_Form_Element_Captcha('captcha', array(
- 'label' => "Vérifiez que vous êtes bien humain :",
- 'captcha' => array(
- 'captcha' => 'Image',
- 'wordLen' => 10,
- 'timeout' => 300,
- 'font' => $config->baseURL.'/Helvetica.ttf',
- 'imgDir' => $config->baseURL.'/tmp',
- 'imgUrl' => $config->baseURL.'/tmp',
- ),
- ));
- $this->addElement($captcha);
- // Zend_Debug::dump($captcha); exit();
- $submit = $this->addElement('submit', 'submit', array(
- 'required' => false,
- 'ignore' => true,
- 'label' => 'Submit'
- ));
- $this->submit->removeDecorator('label');
- $this->setDecorators(array(
- 'FormElements',
- array('HtmlTag', array('tag' => 'div', 'class' => 'form element')),
- 'Form'
- ));
- }
- }
- Warning: imageftbbox() [function.imageftbbox]: Could not find/open font in /usr/local/zend/share/ZendFramework/library/Zend/Captcha/Image.php on line 489
- Warning: imagefttext() [function.imagefttext]: Could not find/open font in /usr/local/zend/share/ZendFramework/library/Zend/Captcha/Image.php on line 492
- Warning: imagepng() [function.imagepng]: Unable to open '/wams3/tmp/c35e7712254d0453a5ab05af9a27b9c3.png' for writing: No such file or directory in /usr/local/zend/share/ZendFramework/library/Zend/Captcha/Image.php on line 563
Add Comment
Please, Sign In to add comment