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


PHP Zend_Form_Element_Textarea::addFilters方法代码示例

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


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

示例1: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'empadditionaldetails');
     $id = new Zend_Form_Element_Hidden('id');
     $userid = new Zend_Form_Element_Hidden('user_id');
     $military_status = new Zend_Form_Element_Select('military_status');
     $military_status->setLabel('Served in Military ?');
     $military_status->setAttrib('onchange', 'displaydates(this)');
     $military_status->setRegisterInArrayValidator(false);
     $military_status->setMultiOptions(array('' => 'Select Military Status', '1' => 'Yes', '2' => 'No'));
     $military_status->setRequired(true);
     $military_status->addValidator('NotEmpty', false, array('messages' => 'Please enter military status.'));
     $countries_served = new Zend_Form_Element_Select('countries_served');
     $countries_served->setLabel('Countries Served');
     $countries_served->setRegisterInArrayValidator(false);
     $branch_service = new Zend_Form_Element_Text('branch_service');
     $branch_service->setAttrib('maxlength', 30);
     $branch_service->setLabel('Branch of Service');
     $branch_service->addValidator("regex", true, array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\. ]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid branch of service.')));
     $branch_service->addFilters(array('StringTrim'));
     $rank_achieved = new Zend_Form_Element_Text('rank_achieved');
     $rank_achieved->setAttrib('maxlength', 30);
     $rank_achieved->setLabel('Rank Achieved');
     $rank_achieved->addValidator("regex", true, array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\. ]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid rank achieved.')));
     $rank_achieved->addFilters(array('StringTrim'));
     $from_date = new Zend_Form_Element_Text('from_date');
     $from_date->setLabel('From');
     $from_date->setAttrib('readonly', 'true');
     $from_date->setAttrib('onfocus', 'this.blur()');
     $to_date = new Zend_Form_Element_Text('to_date');
     $to_date->setLabel('To');
     $to_date->setAttrib('readonly', 'true');
     $to_date->setAttrib('onfocus', 'this.blur()');
     $discharge_status = new Zend_Form_Element_Select('discharge_status');
     $discharge_status->setLabel('Status of Discharge');
     $discharge_status->setRegisterInArrayValidator(false);
     $discharge_status->setMultiOptions(array('' => 'Select Status', '1' => 'Honorable', '2' => 'Medical'));
     $service_number = new Zend_Form_Element_Text('service_number');
     $service_number->setAttrib('maxlength', 30);
     $service_number->setLabel('Military Service Number');
     $service_number->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9\\-\\. ]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid service number.')));
     $service_number->addFilters(array('StringTrim'));
     $rank = new Zend_Form_Element_Text('rank');
     $rank->setAttrib('maxlength', 30);
     $rank->setLabel('Current/Ending Rank');
     $rank->addValidator("regex", true, array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\. ]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid current/ending rank.')));
     $rank->addFilters(array('StringTrim'));
     $verification_report = new Zend_Form_Element_Text('verification_report');
     $verification_report->setAttrib('maxlength', 30);
     $verification_report->setLabel('Military Verification Report');
     $verification_report->addValidator("regex", true, array('pattern' => '/^[a-zA-Z][a-zA-Z0-9\\-\\. ]*$/', 'messages' => array('regexNotMatch' => 'Please enter valid verification report.')));
     $verification_report->addFilters(array('StringTrim'));
     $military_servicetype = new Zend_Form_Element_Select('military_servicetype');
     $military_servicetype->setLabel('Military Service Type');
     $military_servicetype->setRegisterInArrayValidator(false);
     $veteran_status = new Zend_Form_Element_Select('veteran_status');
     $veteran_status->setLabel('Veteran Status');
     $veteran_status->setRegisterInArrayValidator(false);
     $special_training = new Zend_Form_Element_Textarea('special_training');
     $special_training->setLabel('Special Trainings');
     $special_training->setAttrib('rows', 10);
     $special_training->setAttrib('cols', 50);
     $special_training->setAttrib('maxlength', '400');
     $special_training->addFilters(array('StringTrim'));
     $awards = new Zend_Form_Element_Textarea('awards');
     $awards->setLabel('Awards/ Honors Received');
     $awards->setAttrib('rows', 10);
     $awards->setAttrib('cols', 50);
     $awards->setAttrib('maxlength', '400');
     $awards->addFilters(array('StringTrim'));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $this->addElements(array($id, $userid, $military_status, $countries_served, $branch_service, $rank_achieved, $from_date, $to_date, $discharge_status, $service_number, $rank, $verification_report, $military_servicetype, $veteran_status, $special_training, $awards, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:lukkyrich,项目名称:sentrifugo,代码行数:78,代码来源:empadditionaldetails.php


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