public function __construct($useOldPassword = true)
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'panel-body');
     if ($useOldPassword) {
         $oldPassword = new Password('oldPassword');
         $oldPassword->setLabel('old.password');
         $oldPassword->setAttribute('class', 'form-control');
         $this->add($oldPassword);
     }
     $password = new Password('password');
     $password->setLabel('password');
     $password->setAttribute('class', 'form-control');
     $this->add($password);
     $password2 = new Password('password2');
     $password2->setLabel('repeat.password');
     $password2->setAttribute('class', 'form-control');
     $this->add($password2);
     $captcha = new Captcha('register_captcha');
     $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']);
     $imageAdapter->setHeight(100);
     $imageAdapter->setWidth(400);
     $imageAdapter->setFontSize(48);
     $imageAdapter->setDotNoiseLevel(400);
     $imageAdapter->setLineNoiseLevel(40);
     $captcha->setCaptcha($imageAdapter);
     $captcha->setLabel('enter.text.from.the.picture');
     $captcha->setAttribute('class', 'form-control');
     $this->add($captcha);
     $submit = new Submit('save');
     $submit->setValue('save');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'panel-body');
     $mail = new Email('email');
     $mail->setLabel('email');
     $mail->setAttribute('class', 'form-control');
     $this->add($mail);
     $captcha = new Captcha('register_captcha');
     $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']);
     $imageAdapter->setHeight(100);
     $imageAdapter->setWidth(400);
     $imageAdapter->setFontSize(48);
     $imageAdapter->setDotNoiseLevel(400);
     $imageAdapter->setLineNoiseLevel(40);
     $captcha->setCaptcha($imageAdapter);
     $captcha->setLabel('enter.text.from.the.picture');
     $captcha->setAttribute('class', 'form-control');
     $this->add($captcha);
     $submit = new Submit('send');
     $submit->setValue('send');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     $this->setName('mega');
     $this->setAttribute('method', 'post');
     // hidden
     $this->add(array('name' => 'one', 'attributes' => array('type' => 'hidden')));
     // Text
     $this->add(array('name' => 'two', 'attributes' => array('type' => 'text', 'label' => 'Two')));
     // Textarea
     $this->add(array('name' => 'three', 'attributes' => array('type' => 'textarea', 'label' => 'Three')));
     // MultiCheckbox
     $this->add(array('name' => 'four', 'attributes' => array('type' => 'multiCheckbox', 'label' => 'Four', 'options' => array('one' => '1', 'two' => '2'))));
     // Radio
     $this->add(array('name' => 'five', 'attributes' => array('type' => 'radio', 'label' => 'Five', 'options' => array('one' => '1', 'two' => '2'))));
     // Select
     $this->add(array('name' => 'six', 'attributes' => array('type' => 'select', 'label' => 'Six', 'options' => array('one' => '1', 'two' => '2'))));
     // Captcha
     $captcha = new Element\Captcha('seven');
     $captcha->setCaptcha(new DumbCaptchaAdapter());
     $captcha->setAttribute('label', 'Seven');
     $this->add($captcha);
     // Csrf
     $this->add(new Element\Csrf('csrf'));
     // Submit button
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'label' => 'Go')));
 }
Exemplo n.º 4
0
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'panel-body');
     $username = new Text('username');
     $username->setLabel('username');
     $username->setAttribute('class', 'form-control');
     $username->setAttribute('data-urr', '/isusernameinuse');
     $this->add($username);
     $mail = new Email('email');
     $mail->setLabel('email');
     $mail->setAttribute('class', 'form-control');
     $this->add($mail);
     $password = new Password('password');
     $password->setLabel('password');
     $password->setAttribute('class', 'form-control');
     $this->add($password);
     $password2 = new Password('password2');
     $password2->setLabel('repeat.password');
     $password2->setAttribute('class', 'form-control');
     $this->add($password2);
     $captcha = new Captcha('registerCaptcha');
     $imageAdapter = new Image(['font' => __DIR__ . '/../../fonts/arial.ttf']);
     $imageAdapter->setHeight(100);
     $imageAdapter->setWidth(400);
     $imageAdapter->setFontSize(48);
     $imageAdapter->setDotNoiseLevel(400);
     $imageAdapter->setLineNoiseLevel(40);
     $captcha->setCaptcha($imageAdapter);
     $captcha->setLabel('enter.text.from.the.picture');
     $captcha->setAttribute('class', 'form-control');
     $this->add($captcha);
     $agb = new Checkbox('gtcAccept');
     $agb->setLabel('accept.terms.of.gtc');
     $agb->setAttribute('class', 'form-control');
     $agb->setLabelAttributes(['class' => 'checkboxLabel']);
     $this->add($agb);
     $submit = new Submit('register');
     $submit->setValue('register');
     $submit->setAttribute('class', 'btn btn-primary');
     $this->add($submit);
 }