Example #1
0
 public function __construct($name = null)
 {
     parent::__construct($name);
     $this->setAttribute('method', 'post');
     $this->addElements();
     $this->setAttributes(['class' => 'dropzone col-md-12']);
     $this->setAttributes(['action' => '/user/profile/avatar']);
 }
Example #2
0
 public function __construct()
 {
     parent::__construct();
     $this->setAttribute('method', 'post');
     $this->setAttribute('class', 'formAddress');
     $this->setOptions(array('decorator' => array('type' => 'ul')));
     $this->add(array('name' => 'name', 'attributes' => array('type' => 'text', 'class' => 'tb validate[required]', 'id' => 'name'), 'options' => array('label' => 'Tên đầy đủ:', 'decorator' => array('type' => 'li'))));
     $this->add(array('name' => 'mobile', 'attributes' => array('type' => 'text', 'class' => 'tb validate[required,custom[phone]]', 'id' => 'phone'), 'options' => array('label' => 'Mobile:', 'decorator' => array('type' => 'li'))));
     $this->add(array('name' => 'email', 'attributes' => array('type' => 'Zend\\Form\\Element\\Email', 'class' => 'tb validate[required,custom[email]]', 'id' => 'email'), 'options' => array('label' => 'Email:', 'decorator' => array('type' => 'li'))));
     $this->add(array('name' => 'cityId', 'type' => 'select', 'attributes' => array('id' => 'cityId', 'class' => 'validate[required]'), 'options' => array('label' => 'Thành phố:', 'decorator' => array('type' => 'li'))));
     $this->add(array('name' => 'districtId', 'type' => 'select', 'attributes' => array('id' => 'districtId', 'class' => 'validate[required]'), 'options' => array('label' => 'Quận huyện:', 'decorator' => array('type' => 'li'))));
     $this->add(array('name' => 'address', 'attributes' => array('type' => 'text', 'class' => 'tb', 'id' => 'address'), 'options' => array('label' => 'Địa chỉ:', 'decorator' => array('type' => 'li'))));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Gửi', 'id' => 'btnSubmit', 'class' => 'htmlBtn first'), 'options' => array('decorator' => array('type' => 'li', 'attributes' => array('class' => 'btns')))));
     $this->getEventManager()->trigger('init', $this);
 }
Example #3
0
 /**
  * @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' => 'inputStr', 'attributes' => array('type' => 'text', 'class' => 'validate[required],minSize[4]', 'id' => 'newpassword'), 'options' => array('label' => 'Nhập địa chỉ email hoặc tên tài khoản đăng ký:', 'decorator' => array('type' => 'li'))));
     /* $this->add(array(
     			'type'	=>	'Zend\Form\Element\Captcha',
             	'name'	=>	'captcha',
             	'options'	=>	array(
             		'label'	=>	'Nhập mã Captcha',
             		'captcha'	=>	new Captcha\Dumb(),
             	),
             )); */
     $this->add(array('name' => 'csrf', 'type' => 'Zend\\Form\\Element\\Csrf', 'attributes' => array('type' => 'csrf')));
     $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => 'Xác nhận', 'id' => 'btnSubmit', 'class' => 'htmlBtn first btn btn-primary'), 'options' => array('clearBefore' => true, 'decorator' => array('type' => 'li', 'attributes' => array('class' => 'btns')))));
     $this->getEventManager()->trigger('init', $this);
 }
Example #4
0
 /**
  * @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')));
 }