当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Form_Element_Password::addPrefixPath方法代码示例

本文整理汇总了PHP中Zend_Form_Element_Password::addPrefixPath方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Form_Element_Password::addPrefixPath方法的具体用法?PHP Zend_Form_Element_Password::addPrefixPath怎么用?PHP Zend_Form_Element_Password::addPrefixPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Form_Element_Password的用法示例。


在下文中一共展示了Zend_Form_Element_Password::addPrefixPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     /* $email = $this->addElement('text', 'email', array(
        'filters'    => array('StringTrim', 'StringToLower'),
        'validators' => array(
        'EmailAddress',
        ),
        'required'   => true,
        'label'      => $this->translate->_("Email"),
        'decorators' => $this->elementDecorators,
        'description'=>"mustbe lower..."
        )); */
     $email = new Zend_Form_Element_Text("email");
     $email->setLabel('Email');
     $email->setDecorators($this->elementDecorators);
     $email->addValidator("EmailAddress");
     $email->addValidator("ExistUser", false, array("email"));
     $email->addPrefixPath('VC_Validate', 'VC/Validate/', 'validate');
     $this->addElements(array($email));
     /*$username = $this->addElement('text', 'username', array(
           'filters' => array('StringTrim', 'StringToLower'),
           'validators' => array(
               'Alpha',
               array('StringLength', false, array(3, 20)),
           ),
           'required' => true,
           'label' => $this->translate->_("Username"),
           'decorators' => $this->elementDecorators,
       ));
       */
     $token = $this->addElement('hidden', 'token', array('disableLoadDefaultDecorators' => true));
     $password = $this->addElement('password', 'password', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(6, 20))), 'required' => true, 'label' => $this->translate->_("Password"), 'decorators' => $this->elementDecorators));
     /* $re_password = $this->addElement('password', 'password_confirm', array(
        'filters'    => array('StringTrim'),
        'validators' => array(
        array('SL_ValidatorMatch', false, array("password")),
        ),
        'required'   => true,
        'label'      => $this->translate->_("Confirm password"),
        'decorators' => $this->elementDecorators,
        )); */
     $re_password = new Zend_Form_Element_Password("password_confirm");
     $re_password->setLabel('Confirm Password');
     $re_password->setDecorators($this->elementDecorators);
     $re_password->addValidator("PasswordConfirmation", false, array("password"));
     $re_password->addPrefixPath('VC_Validate', 'VC/Validate/', 'validate');
     $this->addElements(array($re_password));
     $username = $this->addElement('text', 'fullname', array('filters' => array('StringTrim'), 'validators' => array(array('StringLength', false, array(3, 70))), 'required' => true, 'label' => $this->translate->_("Full name"), 'decorators' => $this->elementDecorators));
     // Add a captcha
     $this->addElement('captcha', 'captcha', array('label' => $this->translate->_("Please enter the 5 letters displayed below:"), 'required' => true, 'captcha' => array('captcha' => 'Figlet', 'wordLen' => 5, 'timeout' => 300)));
     $login = $this->addElement('submit', 'login', array('required' => false, 'ignore' => true, 'label' => $this->translate->_("Register"), 'decorators' => $this->buttonDecorators));
 }
开发者ID:BGCX261,项目名称:zillatek-project-svn-to-git,代码行数:52,代码来源:Register.php


注:本文中的Zend_Form_Element_Password::addPrefixPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。