本文整理汇总了PHP中Zend_Form_Element_Password::setRenderPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Password::setRenderPassword方法的具体用法?PHP Zend_Form_Element_Password::setRenderPassword怎么用?PHP Zend_Form_Element_Password::setRenderPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Form_Element_Password
的用法示例。
在下文中一共展示了Zend_Form_Element_Password::setRenderPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$this->setName('registerForm');
$this->setMethod('post');
$this->setAction('/user/register/');
$user = new Zend_Form_Element_Text('user');
$user->setLabel('Username');
$user->setRequired(true);
$user->addValidator('Alnum', false);
$user->addValidator('StringLength', true, array(3, 30));
//$user->addValidator('Db_NoRecordExists', true, array('user', 'user') );
$password = new Zend_Form_Element_Password('password');
$password->setLabel('Password');
$password->setRenderPassword(true);
$password->setRequired(true);
$password->addValidator('StringLength', true, array(5, 50));
$name = new Zend_Form_Element_Text('name');
$name->setLabel('Full Name');
$name->setRequired(true);
$name->addValidator('StringLength', true, array(3, 128));
$email = new Zend_Form_Element_Text('email');
$email->setLabel('Email');
$email->setRequired(true);
$email->addValidator('EmailAddress', true);
$email->addValidator('StringLength', true, array(3, 128));
$submit = new Zend_Form_Element_Submit('register');
$submit->setLabel('Register');
$hash = new Zend_Form_Element_Hash('hash');
$this->setElements(array($user, $password, $name, $email, $submit, $hash));
}
示例2: init
public function init()
{
$this->setName('loginForm');
$this->setMethod('post');
$this->setAction('/user/login/');
$user = new Zend_Form_Element_Text('user');
$user->setLabel('Username');
$user->setRequired(true);
//$user->addValidator('Db_NoRecordExists', true, array('user', 'user') );
$password = new Zend_Form_Element_Password('password');
$password->setLabel('Password');
$password->setRenderPassword(false);
$password->setRequired(true);
$submit = new Zend_Form_Element_Submit('login');
$submit->setLabel('Login');
//$hash = new Zend_Form_Element_Hash('hash');
$this->setElements(array($user, $password, $submit));
}
示例3: getRepeatPasswordElement
/**
* Returns/sets a repeat password element.
*
* @return \Zend_Form_Element_Password
*/
public function getRepeatPasswordElement()
{
$element = $this->getElement($this->_repeatPasswordFieldName);
if (!$element) {
// Field repeat password
$element = new \Zend_Form_Element_Password($this->_repeatPasswordFieldName);
$element->setLabel($this->_('Repeat password'));
$element->setAttrib('size', 40);
$element->setRequired(true);
$element->setRenderPassword(true);
$validator = new \MUtil_Validate_IsConfirmed($this->_newPasswordFieldName, $this->_('New password'));
$validator->setMessage($this->_("Must be the same as %fieldDescription%."), \MUtil_Validate_IsConfirmed::NOT_SAME);
$element->addValidator($validator);
$this->addElement($element);
}
return $element;
}