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


PHP Zend_Form_Element_Password::addFilters方法代码示例

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


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

示例1: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAction(BASE_URL . 'dashboard/editpassword');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'editpassword');
     $id = new Zend_Form_Element_Hidden('id');
     $oldPassword = new Zend_Form_Element_Password('password');
     $oldPassword->setAttrib('size', 20);
     $oldPassword->addValidator('NotEmpty', false, array('messages' => 'Please enter current password.'));
     $oldPassword->setAttrib('maxLength', 15);
     $oldPassword->setRequired(true);
     $oldPassword->addFilters(array('StringTrim'));
     $newPassword = new Zend_Form_Element_Password('newpassword');
     $newPassword->setAttrib('size', 20);
     $newPassword->setAttrib('maxLength', 15);
     $newPassword->setRequired(true);
     $newPassword->addValidator('NotEmpty', false, array('messages' => 'Please enter new password.'));
     $newPassword->addValidator('stringLength', true, array('min' => 6, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'The password cannot be more than 15 characters.', Zend_Validate_StringLength::TOO_SHORT => 'New password should be atleast 6 characters long.')));
     $newPassword->addFilters(array('StringTrim'));
     $newPasswordAgain = new Zend_Form_Element_Password('passwordagain');
     $newPasswordAgain->setAttrib('size', 20);
     $newPasswordAgain->setAttrib('maxLength', 15);
     $newPasswordAgain->setRequired(true);
     $newPasswordAgain->addValidator('NotEmpty', false, array('messages' => 'Please enter confirm password.'));
     $newPasswordAgain->addValidator('stringLength', true, array('min' => 6, 'max' => 15, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'The password cannot be more than 15 characters.', Zend_Validate_StringLength::TOO_SHORT => 'Confirm password should be atleast 6 characters long.')));
     $newPasswordAgain->addFilters(array('StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $url = "'dashboard/editpassword/format/json'";
     $dialogMsg = "''";
     $toggleDivId = "''";
     $jsFunction = "''";
     $submit->setOptions(array('onclick' => "saveDetails({$url},{$dialogMsg},{$toggleDivId},{$jsFunction});"));
     $this->addElements(array($id, $oldPassword, $newPassword, $newPasswordAgain, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:38,代码来源:changepassword.php


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