public function testCanAddCaptchaToForm() { $testOptions = ['showCaptcha' => true, 'captchaConfig' => ['private-key' => 'test', 'public-key' => 'test']]; $form = new CaptchaForm('testname', $testOptions); $form->addCaptcha(); $this->assertTrue($form->get('captcha') instanceof Element); }
public function prepare() { $username = new Element('username'); $username->setLabel($this->translate('Your username')); $username->setAttributes(['type' => 'text', 'icon' => 'user', 'class' => 'form-control']); $email = new Element('email'); $email->setLabel($this->translate('Email (used to login)')); $email->setAttributes(['type' => 'text', 'icon' => 'envelope', 'class' => 'form-control']); $password = new Element('password'); $password->setLabel($this->translate('Password')); $password->setAttributes(['type' => 'password', 'id' => 'password', 'icon' => 'lock', 'class' => 'form-control']); $confirmPassword = new Element('confirm-password'); $confirmPassword->setLabel($this->translate('Confirm Password')); $confirmPassword->setAttributes(['type' => 'password', 'icon' => 'lock', 'class' => 'form-control']); $send = new Element('send'); $send->setValue($this->translate('Create My Account')); $send->setAttributes(['type' => 'submit', 'class' => 'btn btn-default']); $this->add($username); $this->add($email); $this->add($password); $this->add($confirmPassword); $this->addCaptcha(); $this->add($send); parent::prepare(); }
public function prepare() { $name = new Element('email'); $name->setLabel('Your email'); $name->setAttributes(['type' => 'text', 'icon' => 'envelope', 'class' => 'form-control']); $message = new Element('message'); $message->setLabel($this->translate('Your question or feedback')); $message->setAttributes(['type' => 'textarea', 'class' => 'form-control']); $send = new Element('send'); $send->setValue('Submit'); $send->setAttributes(['type' => 'submit', 'class' => 'btn btn-default']); $this->add($name); $this->add($message); $this->addCaptcha(); $this->add($send); parent::prepare(); }