Guest User

Untitled

a guest
Jul 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <?php
  2.  
  3. class RegisterForm extends Zend_Form {
  4.  
  5. public function __construct($options = null) {
  6. parent::__construct($options);
  7.  
  8. $config = new Zend_Config_Ini('../application/configs/application.ini', 'production');
  9.  
  10. $nom = $this->addElement('text', 'nom', array(
  11. 'filters' => array('StringTrim', 'StringToLower'),
  12. 'validators' => array(
  13. 'Alpha',
  14. array('StringLength', false, array(3, 20)),
  15. ),
  16. 'required' => true,
  17. 'label' => 'Nom :',
  18. ));
  19. $prenom = $this->addElement('text', 'prenom', array(
  20. 'filters' => array('StringTrim', 'StringToLower'),
  21. 'validators' => array(
  22. 'Alpha',
  23. array('StringLength', false, array(3, 20)),
  24. ),
  25. 'required' => true,
  26. 'label' => 'Prénom :'
  27. ));
  28. $email = $this->addElement('text', 'email', array(
  29. 'filters' => array('StringTrim', 'StringToLower'),
  30. 'validators' => array(
  31. 'Alnum',
  32. array('StringLength', false, array(6, 20)),
  33. ),
  34. 'required' => true,
  35. 'label' => 'Adresse e-mail :'
  36. ));
  37.  
  38. $password = $this->addElement('password', 'password', array(
  39. 'filters' => array('StringTrim'),
  40. 'validators' => array(
  41. 'Alnum',
  42. array('StringLength', false, array(6, 20)),
  43. ),
  44. 'required' => true,
  45. 'label' => 'Mot de passe :'
  46. ));
  47.  
  48. $this->addDisplayGroup(array('nom', 'prenom', 'email', 'password'), 'name', array(
  49. 'legend' => 'Coucou',
  50. ));
  51.  
  52. $captcha = new Zend_Form_Element_Captcha('captcha', array(
  53. 'label' => "Vérifiez que vous êtes bien humain :",
  54. 'captcha' => array(
  55. 'captcha' => 'Image',
  56. 'wordLen' => 10,
  57. 'timeout' => 300,
  58. 'font' => $config->baseURL.'/Helvetica.ttf',
  59. 'imgDir' => $config->baseURL.'/tmp',
  60. 'imgUrl' => $config->baseURL.'/tmp',
  61. ),
  62. ));
  63. $this->addElement($captcha);
  64. // Zend_Debug::dump($captcha); exit();
  65.  
  66. $submit = $this->addElement('submit', 'submit', array(
  67. 'required' => false,
  68. 'ignore' => true,
  69. 'label' => 'Submit'
  70. ));
  71. $this->submit->removeDecorator('label');
  72. $this->setDecorators(array(
  73. 'FormElements',
  74. array('HtmlTag', array('tag' => 'div', 'class' => 'form element')),
  75. 'Form'
  76. ));
  77. }
  78.  
  79. }
  80.  
  81. Warning: imageftbbox() [function.imageftbbox]: Could not find/open font in /usr/local/zend/share/ZendFramework/library/Zend/Captcha/Image.php on line 489
  82.  
  83. Warning: imagefttext() [function.imagefttext]: Could not find/open font in /usr/local/zend/share/ZendFramework/library/Zend/Captcha/Image.php on line 492
  84.  
  85. 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