protected function getConfirmarNovaSenha() { $element = new Password('confirmar_nova_senha'); $element->setLabel('Repetir Nova Senha:'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'Repita a nova senha informada no campo anterior.')); return $element; }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('signin'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setOptions(['layout' => 'fluid']); $filter = $this->getInputFilter(); //$groupBasic = new DisplayGroup('groupBasic'); //$this->add($groupBasic); $csrf = new Csrf('csrf'); $this->add($csrf); $filter->add(array('name' => 'csrf', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $mail = new Text('mail'); $mail->setLabel('Email:'); $mail->setAttributes(array('type' => 'text', 'id' => 'mail')); $this->add($mail); //$groupBasic->addElement($username); $filter->add(array('name' => 'mail', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email đăng nhập'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ')))))); $password = new Password('password'); $password->setAttributes(array('type' => 'password', 'id' => 'password')); $password->setLabel('Mật khẩu:'); $this->add($password); //$groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mật khẩu')))))); $config = $this->getServiceLocator()->get('Config'); $this->captcha = new ReCaptcha(array('pubkey' => $config['captcha']['reCAPTCHA']['publicKey'], 'privkey' => $config['captcha']['reCAPTCHA']['privateKey'], 'ssl' => !isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off' ? false : true)); $captcha = new Captcha('captcha'); $captcha->setLabel('Mã bảo mật:'); $captcha->setCaptcha($this->captcha); $this->add($captcha); //$groupBasic->addElement($captcha); $filter->add(array('name' => 'captcha', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập captcha'))), $this->captcha))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Đăng nhập', 'id' => 'btnSignin', 'class' => 'btn btn-primary col-md-12'))); //$groupBasic->addElement($this->get('submit')); }
public function __construct($name = null) { parent::__construct('datbaseform'); $this->setAttribute('class', 'p-t-15'); $this->setAttributes(array('id' => 'form-datos-bd', 'class' => 'form-horizontal')); $username = new Element('username'); $username->setLabel('Nombre de Usuario:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $username->setAttributes(array('type' => 'text', 'placeholder' => 'ej. Admin', 'id' => 'username', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno", 'data-rule-minlength' => "6", 'data-msg-minlength' => "Debe tener al menos 6 caracteres")); $password = new Element\Password('password'); $password->setLabel('Contraseña:')->setLabelAttributes(array('class' => 'col-sm-3 control-label required')); $password->setAttributes(array('placeholder' => 'No uses 1234 ;)', 'id' => 'password', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno")); $confirmaPassword = new Element\Password('confirmaPassword'); $confirmaPassword->setLabel(' ')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $confirmaPassword->setAttributes(array('placeholder' => 'Por seguridad este campo es necesario', 'id' => 'confirmaPassword', 'class' => 'form-control')); $email = new Element\Email('email'); $email->setLabel('Correo Electrónico:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $email->setAttributes(array('placeholder' => '*****@*****.**', 'id' => 'email', 'class' => 'form-control')); $buttonContinuar = new Element\Button('buttonContinuar'); $buttonContinuar->setLabel('Instalar'); $buttonContinuar->setAttributes(array('class' => 'btn btn-success', 'type' => 'submit', 'id' => 'buttonContinuar')); $buttonLimpiar = new Element\Button('buttonLimpiar'); $buttonLimpiar->setLabel('<i class="pg-close"></i> Limpiar')->setLabelOptions(array('disable_html_escape' => true)); $buttonLimpiar->setAttributes(array('class' => 'btn btn-default', 'id' => 'buttonLimpiar', 'type' => 'reset')); $this->add($username); $this->add($password); $this->add($email); $this->add($confirmaPassword); $this->add($buttonContinuar); $this->add($buttonLimpiar); }
public function getSenha() { $element = new Password('senha'); $element->setLabel('Senha'); $element->setAttributes(array('id' => 'senha', 'class' => 'form-control', 'placeholder' => 'Digite a sua senha')); return $element; }
public function __construct($name = null) { parent::__construct('reginfo'); $id_hidden = new Element\Hidden('id'); $id_hidden->setName('id'); $email_text = new Element\Text('login'); $email_text->setLabel('E-mail'); $email_text->setLabelAttributes(array('class' => 'type_text')); $email_text->setAttributes(array('class' => 'type_text_input', 'placeholder' => 'Type something...', 'disabled' => 'disable')); $type_text = new Element\Text('type'); $type_text->setLabel('Type'); $type_text->setLabelAttributes(array('class' => 'type_text')); $type_text->setAttributes(array('class' => 'type_text_input', 'disabled' => 'disable')); $password_text = new Element\Password('password'); $password_text->setLabel('New password'); $password_text->setLabelAttributes(array('class' => 'type_text')); $password_text->setAttributes(array('id' => 'password', 'class' => 'type_text_input')); $cpassword_text = new Element\Password('cpassword'); $cpassword_text->setLabel('Confirm password'); $cpassword_text->setLabelAttributes(array('class' => 'type_text')); $cpassword_text->setAttributes(array('id' => 'cpassword', 'class' => 'type_text_input')); $this->add($id_hidden); $this->add($email_text); $this->add($type_text); $this->add($password_text); $this->add($cpassword_text); }
public function __construct($name = null) { parent::__construct('datbaseform'); $this->setAttribute('class', 'p-t-15'); $this->setAttributes(array('id' => 'form-datos-bd', 'class' => 'form-horizontal')); $servidorBd = new Element('servidorBd'); $servidorBd->setLabel('Servidor de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $servidorBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. localhost', 'id' => 'servidorBd', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno", 'data-rule-minlength' => "6", 'data-msg-minlength' => "Debe tener al menos 6 caracteres")); $nombreBd = new Element('nombreBd'); $nombreBd->setLabel('Nombre de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label required')); $nombreBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. tributum-produccion', 'id' => 'nombreBd', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno")); $prefijoTablasBd = new Element('prefijoTablasBd'); $prefijoTablasBd->setLabel('Prefijo de tablas de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $prefijoTablasBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. trb-', 'id' => 'prefijoTablasBd', 'class' => 'form-control')); $nombreUsuarioBd = new Element('nombreUsuarioBd'); $nombreUsuarioBd->setLabel('Nombre de usuario de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $nombreUsuarioBd->setAttributes(array('type' => 'text', 'placeholder' => 'ej. root', 'id' => 'nombreUsuarioBd', 'class' => 'form-control', 'data-rule-required' => "true", 'data-msg-required' => "Este campo debe estar lleno")); $contrasenaDb = new Element\Password('contrasenaDb'); $contrasenaDb->setLabel('Contraseña de la base de datos:')->setLabelAttributes(array('class' => 'col-sm-3 control-label')); $contrasenaDb->setAttributes(array('placeholder' => 'Por seguridad este campo es necesario', 'id' => 'contrasenaDb', 'class' => 'form-control')); $buttonContinuar = new Element\Button('buttonContinuar'); $buttonContinuar->setLabel('Continuar'); $buttonContinuar->setAttributes(array('class' => 'btn btn-success', 'type' => 'submit', 'id' => 'buttonContinuar')); $buttonLimpiar = new Element\Button('buttonLimpiar'); $buttonLimpiar->setLabel('<i class="pg-close"></i> Limpiar')->setLabelOptions(array('disable_html_escape' => true)); $buttonLimpiar->setAttributes(array('class' => 'btn btn-default', 'id' => 'buttonLimpiar', 'type' => 'reset')); $this->add($servidorBd); $this->add($nombreBd); $this->add($prefijoTablasBd); $this->add($nombreUsuarioBd); $this->add($contrasenaDb); $this->add($buttonContinuar); $this->add($buttonLimpiar); }
public function __construct($name = null) { parent::__construct('register'); // Creating Fields $first_name = new Text('first_name'); $first_name->setAttributes(array('class' => 'form-control input-lg', 'placeholder' => 'Nome', 'tabindex' => '1')); $last_name = new Text('last_name'); $last_name->setAttributes(array('class' => 'form-control input-lg', 'placeholder' => 'Sobrenome', 'tabindex' => '2')); $email = new Text('email'); $email->setAttributes(array('class' => 'form-control input-lg', 'placeholder' => 'Email', 'tabindex' => '3')); $password = new Password('password'); $password->setAttributes(array('class' => 'form-control input-lg', 'placeholder' => 'Senha', 'tabindex' => '4')); $password_confirmation = new Password('password_confirmation'); $password_confirmation->setAttributes(array('class' => 'form-control input-lg', 'placeholder' => 'Senha', 'tabindex' => '5')); $submit = new Element('submit'); $submit->setAttributes(array('class' => 'btn btn-success btn-block btn-lg', 'type' => 'submit', 'tabindex' => '7'))->setValue('Cadastrar'); // End Creating Fields // Setting Fields $this->add($first_name); $this->add($last_name); $this->add($email); $this->add($password); $this->add($password_confirmation); $this->add($submit, array('priority' => -100)); }
public function __construct() { parent::__construct(); $this->setAttributes(array('class' => 'form')); // Current Password $current = new Element\Password('current_password'); $current->setLabel('Current Password'); $current->setAttributes(array('class' => 'form-control input-sm', 'id' => 'current-password-field')); $this->add($current); // New Password $new = new Element\Password('new_password'); $new->setLabel('New Password'); $new->setAttributes(array('class' => 'form-control input-sm', 'id' => 'new-password-field')); $this->add($new); // Confirm Password $confirm = new Element\Password('confirm_password'); $confirm->setLabel('Confirm Password'); $confirm->setAttributes(array('class' => 'form-control input-sm', 'id' => 'confirm-password-field')); $this->add($confirm); // Submit button. $submit = new Element\Submit('submit'); $submit->setValue('O.K.'); $submit->setAttributes(array('id' => 'submit', 'class' => 'btn btn-sm btn-primary')); $this->add($submit); }
public function __construct($name = null) { parent::__construct('auth'); $this->setAttribute('method', 'post'); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $element = new Element\Email('email'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'email')); $this->add($element); $element = new Element\Password('password'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'password')); $this->add($element); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Войти', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary'))); }
public function __construct($serviceLocator, $options = null) { parent::__construct('AccountIndex'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $group = new DisplayGroup('Search'); $group->setLabel('Tìm kiếm trợ giúp ??'); $this->add($group); // search $search = new Text('search'); $search->setLabel('Tôi cần giúp về: '); $search->setAttributes(['maxlength' => 255, 'class' => 'input-title', 'placeholder' => 'e.g. Need help debugging SASS/CSS for frontend in Rails app']); $this->add($search); $group->addElement($search); $filter->add(array('name' => 'search', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $searchDetail = new Textarea('searchDetail'); $searchDetail->setAttributes(['placeholder' => 'Thêm chi tiết giúp bạn nhận hỗ trợ nhanh hơn', 'class' => 'input-description']); $this->add($searchDetail); $group->addElement($searchDetail); $filter->add(array('name' => 'searchDetail', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $subject = new Text('subject'); $subject->setAttributes(['placeholder' => 'Thêm môn học']); $this->add($subject); $filter->add(array('name' => 'subject', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $subjectId = new Hidden('subjectId'); $this->add($subjectId); $filter->add(array('name' => 'subjectId', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn cần điền ít nhất là 1 môn học')))))); $budget = new Radio('budget'); $budget->setValueOptions(['5' => '20', '10' => '40']); $this->add($budget); $filter->add(array('name' => 'budget', 'required' => false, 'filters' => array(array('name' => 'StringTrim')))); $email = new Text('email'); $email->setLabel('Email'); $this->add($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ')))))); $password = new Password('password'); $password->setAttributes(array('type' => 'password', 'id' => 'password')); $password->setLabel('Mật khẩu:'); $this->add($password); //$groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập mật khẩu')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
public function __construct($name = null) { parent::__construct('auth'); $this->setAttribute('method', 'post'); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $element = new Element\Email('email'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'email')); $this->add($element); $element = new Element\Text('name'); $element->setAttributes(array('required' => TRUE, 'class' => 'form-control', 'placeholder' => 'Введите имя')); $this->add($element); $element = new Element\Password('password'); $element->setAttributes(array('required' => TRUE, 'class' => 'form-control', 'placeholder' => 'Пароль')); $this->add($element); $element = new Element\Password('cpassword'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'Повторите пароль')); $this->add($element); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Зарегистрироваться', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary'))); }
public function __construct() { parent::__construct('auth'); $this->setAttribute('method', 'post'); $this->setAttributes(array('id' => 'auth', 'role' => 'form')); $this->setInputFilter(new AuthFilter()); // Email $email = new Email('email'); $email->setAttributes(array('id' => 'email', 'class' => 'form-control', 'placeholder' => 'Adresse email', 'required' => true, 'autofocus' => true)); $this->add($email); // Password $password = new Password('encryptedPassword'); $password->setAttributes(array('id' => 'encryptedPassword', 'class' => 'form-control', 'placeholder' => 'Mot de passe', 'required' => true)); $this->add($password); // Submit $submit = new Submit('submit'); $submit->setValue('Connexion'); $submit->setAttributes(array('class' => 'btn btn-primary btn-block')); $this->add($submit); }
public function __construct() { parent::__construct(); $this->setAttributes(array('class' => 'form')); // Username $username = new Element\Text('username'); $username->setLabel('User Name'); $username->setAttributes(array('class' => 'form-control input-sm', 'id' => 'username-field')); $this->add($username); // Password $password = new Element\Password('password'); $password->setLabel('Password'); $password->setAttributes(array('class' => 'form-control input-sm', 'id' => 'password-field')); $this->add($password); // Submit button. $submit = new Element\Submit('submit'); $submit->setValue('Login'); $submit->setAttributes(array('id' => 'submit', 'class' => 'btn btn-sm btn-primary')); $this->add($submit); }
public function __construct($name = null) { parent::__construct('user'); $this->setAttribute('method', 'post'); $this->add(array('name' => 'id', 'attributes' => array('type' => 'hidden'))); $element = new Element\Email('email'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'email')); $this->add($element); $element = new Element\Text('name'); $element->setAttributes(array('class' => 'username', 'size' => '30', 'class' => 'form-control', 'placeholder' => 'name')); $this->add($element); $element = new Element\Password('password'); $element->setAttributes(array('class' => 'form-control', 'placeholder' => 'password')); $this->add($element); $element = new Element\Select('role'); $element->setAttributes(array('class' => 'form-control ', 'placeholder' => 'role')); $element->setValueOptions(User::getRoleNames()); $this->add($element); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Send', 'id' => 'submitbutton', 'class' => 'form-control btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct($serviceLocator); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'f'); $this->setAttribute('autocomplete', 'off'); $this->setOptions(['layout' => 'form-2-cols']); $filter = $this->getInputFilter(); $group = new DisplayGroup('Signup'); $group->setLabel('Đăng kí'); $this->add($group); $fullName = new Text('fullName'); $fullName->setLabel('Tên đầy đủ của bạn'); $fullName->setAttributes(['maxlength' => 255, 'class' => 'input-xlarge inputFieldWithTitle']); $group->addElement($fullName); $this->add($fullName); $filter->add(array('name' => 'fullName', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên của bạn')))))); $username = new Text('username'); $username->setLabel('Tên đăng nhập:'); $username->setAttributes(['maxlength' => 255, 'class' => 'input-xlarge inputFieldWithTitle']); $this->add($username); $group->addElement($username); $filter->add(array('name' => 'username', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên đăng nhập'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 4, 'messages' => array('stringLengthTooShort' => 'Tên đăng nhập phải có từ 4 đến 32 kí tự'))), array('name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array('pattern' => "/^[a-z0-9_-]{4,32}\$/", 'messages' => array('regexNotMatch' => 'Chỉ chấp nhận các kí tự là chữ, chữ số, dấu - và dấu _'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'username', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Tên đăng nhập này đã được sử dụng")))))); // code $password = new Password('password'); $password->setLabel('Mật khẩu'); $password->setAttributes(['class' => 'input-xlarge inputFieldWithTitle']); $this->add($password); $group->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên')))))); $password2 = new Password('password2'); $password2->setLabel('Xác nhận mật khẩu:'); $password2->setAttributes(['class' => 'input-xlarge inputFieldWithTitle']); $this->add($password2); $group->addElement($password2); $filter->add(array('name' => 'password2', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Đăng kí', 'id' => 'btnSave', 'class' => 'btn btn-primary'))); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('passwordForgot'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $groupBasic = new DisplayGroup('groupBasic'); $this->add($groupBasic); $password = new Password('password'); $password->setLabel('Mật khẩu mới:'); $password->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($password); $groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự')))))); $rePassword = new Password('rePassword'); $rePassword->setLabel('Nhập lại mật khẩu mới:'); $rePassword->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($rePassword); $groupBasic->addElement($rePassword); $filter->add(array('name' => 'rePassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập lại Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Đặt lại mật khẩu', 'id' => 'btnSubmit', 'class' => 'htmlBtn first btn btn-primary'), 'options' => array('clearBefore' => true, 'decorator' => array('type' => 'li', 'attributes' => array('class' => 'btns'))))); }
public function __construct(EntityManager $objectManager, $type = self::TYPE_EDIT) { parent::__construct('auth'); $this->setAttributes(array('method' => 'post', 'id' => 'auth', 'role' => 'form')); $this->setInputFilter(new UtilisateurFilter($objectManager, $type)); $this->setHydrator(new DoctrineObject($objectManager)); // Id $id = new Hidden('id'); $this->add($id); // Prénom $firtname = new Text('prenom'); $firtname->setAttributes(array('id' => 'prenom', 'class' => 'form-control', 'placeholder' => 'Prénom', 'required' => true, 'autofocus' => true)); $this->add($firtname); // Nom $lastname = new Text('nom'); $lastname->setAttributes(array('id' => 'nom', 'class' => 'form-control', 'placeholder' => 'Nom', 'required' => true, 'autofocus' => true)); $this->add($lastname); // Email $email = new Email('email'); $email->setAttributes(array('id' => 'email', 'class' => 'form-control', 'placeholder' => 'Adresse email', 'required' => true)); $this->add($email); // Password $password = new Password('password'); $password->setAttributes(array('id' => 'password', 'class' => 'form-control', 'placeholder' => 'Mot de passe', 'required' => $type == self::TYPE_ADD, 'autocomplete' => false)); $this->add($password); // Password $password = new Password('passwordConfirmation'); $password->setAttributes(array('id' => 'passwordConfirmation', 'class' => 'form-control', 'placeholder' => 'Confirmation du mot de passe', 'required' => $type == self::TYPE_ADD, 'autocomplete' => false)); $this->add($password); $role = new Select('role'); $role->setValueOptions(Utilisateur::getStaticRoleList())->setAttributes(array('id' => 'role', 'class' => 'form-control', 'required' => true)); $this->add($role); // Submit $submit = new Submit('submit'); $submit->setValue('Enregistrer'); $submit->setAttributes(array('class' => 'btn btn-primary')); $this->add($submit); }
public function __construct() { parent::__construct('loginForm'); $this->setAttributes(array('id' => 'loginForm', 'role' => 'form', 'method' => 'post')); $username = new Element('username'); $username->setLabel('Nombre de Usuario'); $username->setAttributes(array('type' => 'text', 'placeholder' => 'Escribe tu Nombre de Usuario', 'id' => 'username', 'class' => 'form-control')); $password = new Element\Password('password'); $password->setLabel('Contraseña'); $password->setAttributes(array('placeholder' => 'Escribe tu Contraseña', 'id' => 'password', 'class' => 'form-control')); $remember = new Element\Checkbox('remember'); $remember->setLabel('Mantener mi sesión activa'); $remember->setUseHiddenElement(true); $remember->setCheckedValue("1"); $remember->setUncheckedValue("0"); $remember->setAttributes(array('id' => 'remember')); $loginButton = new Element\Button('loginButton'); $loginButton->setLabel('Inicia Sesión'); $loginButton->setAttributes(array('class' => 'btn btn-primary', 'type' => 'submit', 'id' => 'loginButton')); $this->add($username); $this->add($password); $this->add($remember); $this->add($loginButton); }
/** * @param null|string $name */ public function __construct($serviceLocator, $options = null) { parent::__construct('fUserAdd'); $this->setServiceLocator($serviceLocator); $this->setAttribute('method', 'post'); $filter = $this->getInputFilter(); $groupBasic = new DisplayGroup('groupBasic'); $groupBasic->setLabel('Thông tin cơ bản'); $this->add($groupBasic); $username = new Text('username'); $username->setLabel('Tên đăng nhập:'); $username->setAttributes(['maxlength' => 50, 'autocomplete' => 'off']); $this->add($username); $groupBasic->addElement($username); $filter->add(array('name' => 'username', 'required' => true, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'StringToLower')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập tên đăng nhập'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 50, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-50 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-50 kí tự'))), array('name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array('pattern' => "/^[a-z0-9_-]{4,32}\$/", 'messages' => array('regexNotMatch' => 'Chỉ chấp nhận các kí tự là chữ, chữ số, dấu - và dấu _'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'username', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Tên đăng nhập này đã được sử dụng")))))); $fulName = new Text('fullName'); $fulName->setLabel('Họ tên:'); $fulName->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $this->add($fulName); $groupBasic->addElement($fulName); $filter->add(array('name' => 'fullName', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập họ tên'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 255, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-250 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-250 kí tự')))))); $email = new Text('email'); $email->setLabel('Email:'); $email->setAttributes(['maxlength' => 255, 'autocomplete' => 'off']); $this->add($email); $groupBasic->addElement($email); $filter->add(array('name' => 'email', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập email'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 50, 'min' => 4, 'messages' => array(StringLength::TOO_LONG => 'Tên đăng nhập giới hạn 4-50 kí tự', StringLength::TOO_SHORT => 'Tên đăng nhập giới hạn 4-50 kí tự'))), array('name' => 'EmailAddress', 'break_chain_on_failure' => true, 'options' => array('messages' => array('emailAddressInvalidFormat' => 'Địa chỉ email không hợp lệ'))), array('name' => 'Db\\NoRecordExists', 'options' => array('table' => 'users', 'field' => 'email', 'adapter' => \Zend\Db\TableGateway\Feature\GlobalAdapterFeature::getStaticAdapter(), 'messages' => array('recordFound' => "Email này đã được sử dụng")))))); $user = new \User\Model\User(); $role = new Select('role'); $role->setLabel('Phân quyền:'); $role->setValueOptions(['' => '- Phân quyền -'] + $user->getRoleDisplays()); $this->add($role); $groupBasic->addElement($role); $filter->add(array('name' => 'role', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa chọn Phân quyền')))))); $password = new Password('password'); $password->setLabel('Mật khẩu:'); $password->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($password); $groupBasic->addElement($password); $filter->add(array('name' => 'password', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự')))))); $rePassword = new Password('rePassword'); $rePassword->setLabel('Nhập lại Mật khẩu:'); $rePassword->setAttributes(['maxlength' => 32, 'autocomplete' => 'off']); $this->add($rePassword); $groupBasic->addElement($rePassword); $filter->add(array('name' => 'rePassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập lại Mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 32, 'min' => 6, 'messages' => array(StringLength::TOO_LONG => 'Mật khẩu giới hạn 6-32 kí tự', StringLength::TOO_SHORT => 'Mật khẩu giới hạn 6-32 kí tự'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'password', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $mobile = new Text('mobile'); $mobile->setLabel('Mobile:'); $mobile->setAttributes(['maxlength' => 15]); $mobile->setOptions(['leftIcon' => 'fa fa-mobile']); $this->add($mobile); $groupBasic->addElement($mobile); $filter->add(array('name' => 'mobile', 'required' => false, 'filters' => array(array('name' => 'StringTrim'), array('name' => 'Digits')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mobile'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 10, 'max' => 11, 'messages' => array(StringLength::INVALID => 'Mobile phải là dạng 10 hoặc 11 chữ số', StringLength::TOO_SHORT => 'Mobile phải là dạng 10 hoặc 11 chữ số', StringLength::TOO_LONG => 'Mobile phải là dạng 10 hoặc 11 chữ số')))))); // group additional $groupAdditional = new DisplayGroup('groupAdditional'); $groupAdditional->setLabel('Thông tin cá nhân'); $this->add($groupAdditional); $gender = new Select('gender'); $this->add($gender); $groupAdditional->addElement($gender); $gender->setLabel('Giới tính:'); $gender->setValueOptions(array('' => '- Giới tính -', \Home\Model\Consts::GENDER_MALE => 'Nam', \Home\Model\Consts::GENDER_FEMALE => 'Nữ')); $filter->add(array('name' => 'gender', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Giới tính')))))); $birthdate = new Text('birthdate'); $birthdate->setLabel('Ngày sinh:'); $birthdate->setAttributes(['class' => 'datetimepicker', 'data-date-format' => "DD/MM/YYYY"]); $birthdate->setOptions(['leftIcon' => 'fa fa-calendar']); $this->add($birthdate); $groupAdditional->addElement($birthdate); $filter->add(array('name' => 'birthdate', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'Date', 'break_chain_on_failure' => true, 'options' => array('format' => DateBase::getDisplayDateFormat(), 'messages' => array('dateInvalid' => 'Ngày sinh không hợp lệ', 'dateInvalidDate' => 'Ngày sinh không hợp lệ', 'dateFalseFormat' => 'Ngày sinh không hợp lệ')))))); $cityId = new Select('cityId'); $cityId->setLabel('Thành phố:'); $cityId->setValueOptions(array('' => '- Thành phố -')); $this->add($cityId); $groupAdditional->addElement($cityId); $filter->add(array('name' => 'cityId', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập thành phố'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('max' => 250, 'messages' => array(StringLength::INVALID => 'Địa chỉ chỉ giới hạn nhỏ hơn 250 kí tự')))))); $districtId = new Select('districtId'); $districtId->setLabel('Quận huyện:'); $districtId->setValueOptions(array('' => '- Quận huyện -')); $this->add($districtId); $groupAdditional->addElement($districtId); $filter->add(array('name' => 'districtId', 'required' => false, 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập thành phố')))))); $address = new Text('address'); $address->setLabel('Địa chỉ:'); $address->setAttributes(['maxlength' => 255]); $this->add($address); $groupAdditional->addElement($address); $filter->add(array('name' => 'address', 'required' => false, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập địa chỉ')))))); $this->add(array('name' => 'afterSubmit', 'type' => 'radio', 'attributes' => array('value' => '/system/user/add'), 'options' => array('layout' => 'fluid', 'clearBefore' => true, 'label' => 'Sau khi lưu dữ liệu:', 'value_options' => array('/system/user/add' => 'Tiếp tục nhập người dùng', '/system/user/index' => 'Hiện danh sách người dùng')))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSaveCrmContact', 'class' => 'btn btn-primary'))); }
public function __construct(EntityManager $em, OrmPublicador $publicador = null, OrmLogin $orm = null) { parent::__construct("formLogin"); // var_dump($option); // exit(); /* * txtID */ $txtId = new Element\Hidden("id"); /* * txtNome */ $txtEmail = new Element\Email("email"); $txtEmail->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'data-parsley-trigger' => 'change', 'required' => 'true')); /* * txtSenha */ $txtSenha = new Element\Password("senha"); $txtSenha->setAttributes(array('id' => "senha", 'class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'required' => 'true', "data-parsley-trigger" => "change", "data-parsley-length" => "[6, 20]")); /* * txtSenhaConfirma */ $txtSenhaConfirma = new Element\Password("senhaconfirmar"); $txtSenhaConfirma->setAttributes(array('class' => 'form-control', 'placeholder' => 'Nome do Grupo', 'required' => 'true', "data-parsley-trigger" => "change", "data-parsley-equalto" => "#senha")); /* * cmbPublicador */ $dao = $em->getRepository('Stj\\Entity\\OrmPublicador'); if (empty($publicador)) { $lista = $dao->findAll(); } else { $lista = $dao->ListALLWhere($publicador->getGrupo()->getCongregacao()->getId()); } $option = array(); foreach ($lista as $key => $value) { $publicador = new OrmPublicador(); $publicador = $value; $option[$publicador->getId()] = $publicador->getNome(); } $cmbPublicador = new Element\Select('publicador'); $cmbPublicador->setValueOptions($option); $cmbPublicador->setEmptyOption("Selecionar"); $cmbPublicador->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * cmbNivel */ $dao = $em->getRepository('Stj\\Entity\\OrmNivel'); $lista = $dao->ListALL(FALSE); $option = array(); foreach ($lista as $key => $value) { $nivel = new OrmNivel(); $nivel = $value; $option[$nivel->getId()] = $nivel->getNome(); } $cmbNivel = new Element\Select('nivel'); $cmbNivel->setValueOptions($option); $cmbNivel->setEmptyOption("Selecionar"); $cmbNivel->setAttributes(array('class' => 'chosen-select', 'style' => 'width:175px;', 'required' => 'true')); /* * Itoken */ $iToken = new Element\Csrf("iToken"); /* * btnSalvar */ $btnSalvar = new Element\Button('salvar'); $btnSalvar->setAttributes(array('class' => 'btn btn-darkgray btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * btnVoltar */ $btnVoltar = new Element\Button('voltar'); $btnVoltar->setAttributes(array('class' => 'btn btn-blue btn-ef btn-ef-4 btn-ef-4c mb-10', 'type' => 'button')); /* * Preencher Componentes */ if ($orm != null) { $txtId->setValue($orm->getId()); $txtEmail->setValue($orm->getEmail()); $cmbPublicador->setValue($orm->getPublicador()->getId()); $cmbNivel->setValue($orm->getNivel()->getId()); } // Adiciona componetes no form $this->add($txtId); $this->add($txtEmail); $this->add($txtSenha); $this->add($txtSenhaConfirma); $this->add($cmbPublicador); $this->add($cmbNivel); $this->add($iToken); $this->add($btnSalvar); $this->add($btnVoltar); $this->setAttributes(array('id' => 'form', 'data-parsley-validate' => NULL)); }
/** * @param null|string $name */ public function __construct($name = null) { parent::__construct($name); $this->setAttribute('method', 'post'); $this->setAttribute('class', 'profile'); $this->setOptions(array('decorator' => array('type' => 'ul'))); // $this->add(array( // 'name' => 'oldpassword', // 'attributes' => array( // 'type' => 'password', // 'class' => 'validate[required],minSize[6]', // 'id' => 'oldpassword' // ), // 'options' => array( // 'label' => 'Mật khẩu cũ:', // 'decorator' => array('type' => 'li') // ), // )); // $this->add(array( // 'name' => 'newpassword', // 'attributes' => array( // 'type' => 'password', // 'class' => 'validate[required],minSize[6]', // 'id' => 'newpassword' // ), // 'options' => array( // 'label' => 'Mật khẩu mới:', // 'decorator' => array('type' => 'li') // ), // )); // $this->add(array( // 'name' => 'repassword', // 'attributes' => array( // 'type' => 'password', // 'class' => 'validate[required],minSize[6],equals[newpassword]', // 'id' => 'repassword' // ), // 'options' => array( // 'label' => 'Nhập lại mật khẩu mới:', // 'decorator' => array('type' => 'li') // ), // )); // $this->getEventManager()->trigger('init', $this); // $this->add(array( // 'name' => 'submit', // 'attributes' => array( // 'type' => 'submit', // 'value' => 'Xác nhận', // 'id' => 'btnSubmit', // 'class' => 'htmlBtn first' // ), // 'options' => array( // 'decorator' => array( // 'type' => 'li', // 'attributes' => array( // 'class' => 'btns' // ) // ) // ), // )); $filter = $this->getInputFilter(); $changePass = new DisplayGroup('changePass'); $changePass->setLabel('Đổi mật khẩu'); $this->add($changePass); $oldPass = new Password('oldpassword'); $oldPass->setLabel('Mật khẩu cũ:'); $oldPass->setAttributes(['maxlength' => 255, 'class' => 'validate[required],minSize[6]']); $this->add($oldPass); $changePass->addElement($oldPass); $filter->add(array('name' => 'oldpassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu cũ'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên')))))); $newPass = new Password('newpassword'); $newPass->setLabel('Mật khẩu mới:'); $newPass->setAttributes(['maxlength' => 255, 'class' => 'validate[required],minSize[6]']); $this->add($newPass); $changePass->addElement($newPass); $filter->add(array('name' => 'newpassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Mật khẩu mới'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên')))))); $conPass = new Password('conpassword'); $conPass->setLabel('Nhập lại mật khẩu mới:'); $conPass->setAttributes(['maxlength' => 255, 'class' => 'validate[required],minSize[6],equals[newpassword]']); $this->add($conPass); $changePass->addElement($conPass); $filter->add(array('name' => 'conpassword', 'required' => true, 'filters' => array(array('name' => 'StringTrim')), 'validators' => array(array('name' => 'NotEmpty', 'break_chain_on_failure' => true, 'options' => array('messages' => array('isEmpty' => 'Bạn chưa nhập Xác nhận mật khẩu'))), array('name' => 'StringLength', 'break_chain_on_failure' => true, 'options' => array('min' => 6, 'messages' => array('stringLengthTooShort' => 'Mật khẩu phải có từ 6 kí tự trở lên'))), array('name' => 'Identical', 'break_chain_on_failure' => true, 'options' => array('token' => 'newpassword', 'messages' => array('notSame' => 'Xác nhận mật khẩu không chính xác')))))); $this->add(array('name' => 'submit', 'options' => array('clearBefore' => true), 'attributes' => array('type' => 'submit', 'value' => 'Lưu', 'id' => 'btnSaveCrmContact', 'class' => 'btn btn-primary'))); }