public function prepare()
 {
     $email = new Element('passwordreset-email');
     $email->setLabel($this->translate('Email'));
     $email->setAttributes(['id' => 'passwordreset-email', 'type' => 'text', 'icon' => 'envelope', 'class' => 'form-control']);
     $this->add($email);
     $send = new Element('send');
     $send->setValue('Request password reset');
     $send->setAttributes(['type' => 'submit', 'class' => 'btn btn-default']);
     $this->add($send);
     parent::prepare();
 }
 /**
  * @outputBuffering disabled
  */
 public function testCanRenderFieldsets()
 {
     $this->expectOutputRegex('/<form(.*)<fieldset(.*)<\\/fieldset>(.*)<fieldset(.*)<\\/fieldset>(.*)<\\/form>/');
     $form = new NetsensiaForm();
     $form->addHidden('test1', 'testvalue');
     $hidden = new Element\Hidden('asdasd');
     $hidden->setValue('123');
     $form->add($hidden);
     $element1 = new Text('testelement1');
     $element1->setLabel('Test Element');
     $element1->setAttribute('icon', 'pencil');
     $element2 = new Text('testelement2');
     $element2->setLabel('Test Element 2');
     $element2->setAttribute('icon', 'pencil');
     $fieldset1 = new Fieldset('testfieldset1');
     $fieldset1->add($element1);
     $fieldset2 = new Fieldset('testfieldset2');
     $fieldset2->add($element2);
     $form->add($fieldset1);
     $form->add($fieldset2);
     $helpers = new HelperPluginManager();
     $helpers->setService('formElement', new FormElement());
     $view = new PhpRenderer();
     $view->setHelperPluginManager($helpers);
     $viewHelper = new BootstrapForm();
     $viewHelper->setView($view);
     $viewHelper($form, 'testform', '/');
 }
 public function prepare()
 {
     $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('Update password'));
     $send->setAttributes(['type' => 'submit', 'class' => 'btn btn-success']);
     $this->add($password);
     $this->add($confirmPassword);
     $this->add($send);
     parent::prepare();
 }
示例#4
0
 public function prepare()
 {
     $email = new Element('login-email');
     $email->setLabel($this->translate('Email'));
     $email->setAttributes(['id' => 'login-email-standard', 'type' => 'text', 'icon' => 'envelope', 'class' => 'form-control']);
     $password = new Element('login-password');
     $password->setLabel($this->translate('Password'));
     $password->setAttributes(['type' => 'password', 'id' => 'login-password-standard', 'icon' => 'lock', 'class' => 'form-control']);
     $rememberMe = new Checkbox('rememberme');
     $rememberMe->setLabel($this->translate('Remember me'));
     $send = new Element('send');
     $send->setValue('Login');
     $send->setAttributes(['type' => 'submit', 'class' => 'btn btn-default']);
     $this->add($email);
     $this->add($password);
     $this->add($rememberMe);
     $this->add($send);
     parent::prepare();
 }
示例#5
0
 public function __construct($name = null, $options = array())
 {
     parent::__construct($name, $options);
 }
 public function testCanCreateUpdatePasswordForm()
 {
     $form = new NetsensiaForm();
     $form->addHidden('test', 'testvalue');
     $this->assertTrue($form->get('test') instanceof Element);
 }