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


PHP Zend_Form_Element_Hidden::addValidator方法代码示例

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


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

示例1: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'formid');
     $this->setAttrib('name', 'roles');
     $id = new Zend_Form_Element_Hidden('id');
     $rolename = new Zend_Form_Element_Text('rolename');
     $rolename->setAttrib('maxLength', 50);
     $rolename->setAttrib('title', 'Role name');
     $rolename->addFilter(new Zend_Filter_StringTrim());
     $rolename->setRequired(true);
     $rolename->addValidator('NotEmpty', false, array('messages' => 'Please enter role name.'));
     $rolename->addValidator("regex", true, array('pattern' => '/^[a-zA-Z0-9 ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid role name.')));
     $rolename->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_roles', 'field' => 'rolename', 'exclude' => 'id!="' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive!=0')));
     $rolename->getValidator('Db_NoRecordExists')->setMessage('Role name already exists.');
     $rolename->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 50, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Role name must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Role name must contain at least %min% characters.')))));
     $roletype = new Zend_Form_Element_Text('roletype');
     $roletype->setRequired(true);
     $roletype->setAttrib('maxLength', 25);
     $roletype->setAttrib('title', 'Role type');
     $roletype->addFilter(new Zend_Filter_StringTrim());
     $roletype->addValidator('NotEmpty', false, array('messages' => 'Please enter role type.'));
     $roletype->addValidator("regex", true, array('pattern' => '/^[a-zA-Z]+?$/', 'messages' => array('regexNotMatch' => 'Please enter only alphabets.')));
     $roletype->addValidator(new Zend_Validate_Db_NoRecordExists(array('table' => 'main_roles', 'field' => 'roletype', 'exclude' => 'id != "' . Zend_Controller_Front::getInstance()->getRequest()->getParam('id') . '" and isactive != 0')));
     $roletype->getValidator('Db_NoRecordExists')->setMessage('Role type already exists.');
     $roletype->addValidators(array(array('StringLength', false, array('min' => 3, 'max' => 25, 'messages' => array(Zend_Validate_StringLength::TOO_LONG => 'Role type must contain at most %max% characters.', Zend_Validate_StringLength::TOO_SHORT => 'Role type must contain at least %min% characters.')))));
     $roledescription = new Zend_Form_Element_Textarea('roledescription');
     $roledescription->setAttrib('rows', 10);
     $roledescription->setAttrib('cols', 50);
     $roledescription->setAttrib('maxlength', '100');
     $roledescription->setAttrib('title', 'Role description');
     $levelid = new Zend_Form_Element_Hidden('levelid');
     $levelid->addFilter(new Zend_Filter_StringTrim());
     $levelid->setRequired(true);
     $levelid->addValidator('NotEmpty', false, array('messages' => 'Please select level.'));
     $istimeActive = Zend_Controller_Front::getInstance()->getRequest()->getParam('istimeactive');
     $prev_cnt = new Zend_Form_Element_Hidden('prev_cnt');
     $prev_cnt->setRequired(true);
     if ($istimeActive) {
         $prev_cnt->addValidator('NotEmpty', false, array('messages' => 'Please select privileges other than time management.'));
     } else {
         $prev_cnt->addValidator('NotEmpty', false, array('messages' => 'Please select privileges.'));
     }
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->setLabel('Save');
     $url = "'roles/saveupdate/format/json'";
     $dialogMsg = "''";
     $toggleDivId = "''";
     $jsFunction = "'redirecttocontroller(\\'roles\\');'";
     $submit->setOptions(array('onclick' => "saveDetails({$url},{$dialogMsg},{$toggleDivId},{$jsFunction});"));
     $this->addElements(array($id, $rolename, $roletype, $roledescription, $levelid, $submit, $prev_cnt));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:samdubey,项目名称:sentrifugo,代码行数:54,代码来源:Roles.php

示例2: init

 public function init()
 {
     // initialize form
     $this->setName('newReceivableForm')->setAction('/projects/receivable/create')->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'Area')), 'Form'))->setMethod('post');
     $project = new Zend_Form_Element_Hidden('project');
     $project->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($project);
     $project->setDecorators(array('ViewHelper'));
     //$this->addElementText('title', 'Recebimento', new C3op_Util_ValidString, 50);
     $elementText = new Zend_Form_Element_Text('title');
     $elementText->setLabel('Recebimento')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'eleven columns omega')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Right'))))->setOptions(array('class' => 'eleven columns alpha omega'))->addValidator(new C3op_Util_ValidString())->addFilter('StringTrim');
     $this->addElement($elementText);
     // $this->addElementText('predictedDate', 'Data Prevista', new C3op_Util_ValidDate, 50);
     $elementText = new Zend_Form_Element_Text('predictedDate');
     $elementText->setLabel('Data Prevista')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'three columns')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Right'))))->setOptions(array('class' => 'three columns alpha omega'))->addValidator(new C3op_Util_ValidString())->addFilter('StringTrim');
     $this->addElement($elementText);
     //$this->addElementText('realDate', 'Data Realizada', new C3op_Util_ValidDate, 50);
     $elementText = new Zend_Form_Element_Text('realDate');
     $elementText->setLabel('Data Realizada')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'three columns inset-by-three omega')), array('Label', array('tag' => 'div', 'tagClass' => 'two columns Right'))))->setOptions(array('class' => 'three columns alpha omega'))->addValidator(new C3op_Util_ValidString())->addFilter('StringTrim');
     $this->addElement($elementText);
     // $this->addElementText('predictedValue', 'Valor Previsto', new C3op_Util_ValidPositiveFloat, 50);
     $elementText = new Zend_Form_Element_Text('predictedValue');
     $elementText->setLabel('Valor Previsto')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'three columns')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Right'))))->setOptions(array('class' => 'three columns alpha omega'))->addValidator(new C3op_Util_ValidString())->addFilter('StringTrim');
     $this->addElement($elementText);
     // $this->addElementText('realValue', 'Valor Realizado', new C3op_Util_ValidPositiveFloat, 50);
     $elementText = new Zend_Form_Element_Text('realValue');
     $elementText->setLabel('Valor Realizado')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'three columns inset-by-three omega')), array('Label', array('tag' => 'div', 'tagClass' => 'two columns Right'))))->setOptions(array('class' => 'three columns alpha omega'))->addValidator(new C3op_Util_ValidString())->addFilter('StringTrim');
     $this->addElement($elementText);
     // create submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Gravar')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'five columns inset-by-six omega')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Invisible'))))->setOptions(array('class' => 'submit two columns alpha omega'));
     $this->addElement($submit);
 }
开发者ID:racporto,项目名称:c3op,代码行数:33,代码来源:ReceivableCreate.php

示例3: __construct

 /** The constructor
  * @access public
  * @param array $options
  * @return void
  */
 public function __construct(array $options = null)
 {
     $periods = new Periods();
     $periodword_options = $periods->getPeriodFromWords();
     $activities = new PrimaryActivities();
     $activities_options = $activities->getTerms();
     $counties = new OsCounties();
     $county_options = $counties->getCountiesID();
     parent::__construct($options);
     $name = new Zend_Form_Element_Text('fullname');
     $name->setLabel('Filter by name')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Come on it\'s not that hard, enter a title!')->setAttrib('size', 20);
     $organisation = new Zend_Form_Element_Text('organisation');
     $organisation->setLabel('Filter by organisation')->addFilters(array('StripTags', 'StringTrim', 'Purifier'))->addErrorMessage('Enter a valid organisation')->setAttrib('size', 20);
     $organisationID = new Zend_Form_Element_Hidden('organisationID');
     $organisationID->addValidator('Alnum', false, array('allowWhiteSpace' => false))->addFilters(array('StripTags', 'StringTrim'));
     $county = new Zend_Form_Element_Select('county');
     $county->setLabel('Filter by county')->addValidator('Alpha', false, array('allowWhiteSpace' => true))->addFilters(array('StripTags', 'StringTrim'))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addValidator('StringLength', false, array(1, 200))->addMultiOptions(array(null => 'Choose county', 'Available counties' => $county_options))->addValidator('InArray', false, array(array_keys($county_options)));
     $primary = new Zend_Form_Element_Select('primary_activity');
     $primary->setLabel('Filter by activity')->addFilters(array('StripTags', 'StringTrim'))->addValidator('StringLength', false, array(1, 200))->setAttrib('class', 'input-xxlarge selectpicker show-menu-arrow')->addMultiOptions(array(null => 'Choose activity', 'Available activities' => $activities_options))->addValidator('InArray', false, array(array_keys($county_options)));
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_salt)->setTimeout(4800);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Filter');
     $this->addElements(array($name, $county, $organisation, $organisationID, $primary, $submit, $hash));
     parent::init();
 }
开发者ID:lesleyauk,项目名称:findsorguk,代码行数:32,代码来源:PersonFilterForm.php

示例4: init

 public function init()
 {
     $this->setName('newPhoneNumberForm')->setAction('/register/contact/add-phone-number')->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'Area')), 'Form'))->setMethod('post');
     $contact = new Zend_Form_Element_Hidden('contact');
     $contact->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($contact);
     $label = new Zend_Form_Element_Text('label');
     $labelValidator = new C3op_Register_ContactValidName();
     $label->setLabel('Descrição:')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'eleven columns omega')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Right'))))->setOptions(array('class' => 'eleven columns alpha omega'))->setRequired(true)->addValidator($labelValidator)->addFilter('StringTrim');
     // attach elements to form
     $this->addElement($label);
     $areaCode = new Zend_Form_Element_Text('areaCode');
     $phoneValidator = new C3op_Register_ValidPhoneAreaCode();
     $areaCode->setLabel('Código de área:')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'eleven columns omega')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Right'))))->setOptions(array('class' => 'eleven columns alpha omega'))->setRequired(false)->addValidator($phoneValidator)->addFilter('StringTrim');
     // attach elements to form
     $this->addElement($areaCode);
     $localNumber = new Zend_Form_Element_Text('localNumber');
     $phoneValidator = new C3op_Register_ValidPhoneLocalNumber();
     $localNumber->setLabel('Número local:')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tagClass' => 'div', 'class' => 'eleven columns omega')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Right'))))->setOptions(array('class' => 'eleven columns alpha omega'))->setRequired(false)->addValidator($phoneValidator)->addFilter('StringTrim');
     // attach elements to form
     $this->addElement($localNumber);
     // create submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Gravar')->setDecorators(array('ViewHelper', 'Errors', array(array('data' => 'HtmlTag'), array('tag' => 'div', 'class' => 'five columns inset-by-six omega')), array('Label', array('tag' => 'div', 'tagClass' => 'three columns alpha Invisible'))))->setOptions(array('class' => 'submit two columns alpha omega'));
     $this->addElement($submit);
 }
开发者ID:racporto,项目名称:c3op,代码行数:26,代码来源:PhoneNumberCreate.php

示例5: init

 public function init()
 {
     parent::init();
     $this->setName('newPhoneNumberForm')->setAction('/register/contact/change-phone-number')->setDecorators(array('FormElements', array('HtmlTag', array('tag' => 'div', 'class' => 'Area')), 'Form'))->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
 }
开发者ID:racporto,项目名称:c3op,代码行数:8,代码来源:PhoneNumberEdit.php

示例6: init

 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oPostStep = new Zend_Form_Element_Hidden("post_step");
     $oPostStep->addValidator(new Zend_Validate_GreaterThan(0));
     $oPostStep->addValidator(new Zend_Validate_LessThan(2));
     $oPostStep->setValue(1);
     $oPostStep->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oPostStep);
     $oUserIdSelect = new Zend_Form_Element_Select("search_notification_user_id");
     $oUserIdSelect->setLabel("Konsultant:");
     $oUserIdSelect->setRequired(FALSE);
     $oUserIdSelect->addMultiOptions($this->_aAllUser);
     $this->addElement($oUserIdSelect);
     $oFromInitDate = new Zend_Form_Element_Text("from_init_date");
     $oFromInitDate->setLabel("Data rozpoczęcia (od):");
     $oFromInitDate->setRequired(FALSE);
     $oFromInitDate->setFilters($this->_aFilters);
     $this->addElement($oFromInitDate);
     $oToInitDate = new Zend_Form_Element_Text("to_init_date");
     $oToInitDate->setLabel("Data rozpoczęcia (do):");
     $oToInitDate->setRequired(FALSE);
     $oToInitDate->setFilters($this->_aFilters);
     $this->addElement($oToInitDate);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "search_statistics");
     $oSubmit->setLabel("Szukaj");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/_defaultform.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
开发者ID:lstaszak,项目名称:zf_zk_aleph,代码行数:45,代码来源:SearchStatistics.php

示例7: init

 public function init()
 {
     parent::init();
     // initialize form
     $this->setName('editInstitutionForm')->setAction('/register/institution/edit')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
 }
开发者ID:racporto,项目名称:c3op,代码行数:9,代码来源:InstitutionEdit.php

示例8: init

 public function init()
 {
     parent::init();
     // initialize form
     $this->setName('editUserForm')->setAction('/auth/user/edit')->setMethod('post');
     $password = $this->getElement('password');
     $password->setRequired(false);
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
 }
开发者ID:racporto,项目名称:c3op,代码行数:11,代码来源:UserEdit.php

示例9: init

    public function init()
    {
        $this->setMethod('post');
        $this->setAttrib('enctype', 'multipart/form-data');

        $photo = new Zend_Form_Element_File('photo');
        $photo->setLabel('photo.upload');
        $photo->setDestination($this->getAttrib('tmp'));

        $photo->addValidator('Count', false, 1);
        $photo->addValidator('Size', false, $this->getAttrib('filesize'));
        $photo->addValidator(
            'Extension', false, $this->getAttrib('extensions')
        );

        $photo->setRequired(true);
        $photo->removeDecorator('Errors');

        $this->addElement($photo, 'photo');

        $fbId = new Zend_Form_Element_Hidden('fbid');
        $fbId->addValidator(
            'Db_NoRecordExists', false,
            array(
                'table' => 'zdjecia',
                'field' => 'fbuserid'
            )
        );
        $fbId->setLabel('fbid');

        $fbId->setRequired(true);
        $fbId->removeDecorator('Errors');
        $fbId->removeDecorator('Label');

        $this->addElement($fbId);

        $save = new Zend_Form_Element_Submit('Save');
        $save->setLabel('Zgłoś Zdjęcie');
        $save->setAttrib('class', 'ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only');

        $this->addElement($save);

        $this->addDecorator(
                new Zend_Form_Decorator_FormErrors(
                    array(
                        'ignoreSubForms'=>true,
                        'markupListStart' => '<ul class="ui-state-error ui-corner-all">',
                    )
                )
            )
            ->addDecorator('FormElements')
            ->addDecorator('HtmlTag')
            ->addDecorator('Form');
    }
开发者ID:robsohn,项目名称:portret-jesienny,代码行数:54,代码来源:Zdjecie.php

示例10: init

 public function init()
 {
     parent::init();
     // initialize form
     $this->setName('editContactForm')->setAction('/register/contact/edit')->setMethod('post');
     $id = new Zend_Form_Element_Hidden('id');
     $id->addValidator('Int')->addFilter('StringTrim');
     $this->addElement($id);
     $this->removeElement('areaCode');
     $this->removeElement('localNumber');
 }
开发者ID:racporto,项目名称:c3op,代码行数:11,代码来源:ContactEdit.php

示例11: init

 public function init()
 {
     $this->setTitle('Delete Advertisement')->setDescription('Are you sure you want to delete this advertisement? ');
     $ad_id = new Zend_Form_Element_Hidden('ad_id');
     $ad_id->addValidator('Int');
     $this->addElements(array($ad_id));
     // Buttons
     $this->addElement('Button', 'submit', array('label' => 'Delete Ad', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
     $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => '', 'onclick' => 'parent.Smoothbox.close();', 'decorators' => array('ViewHelper')));
     $this->addDisplayGroup(array('submit', 'cancel'), 'buttons');
     $button_group = $this->getDisplayGroup('buttons');
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:12,代码来源:Addelete.php

示例12: init

 public function init()
 {
     $this->setName(strtolower(get_class()));
     $this->setMethod("post");
     $oFormName = new Zend_Form_Element_Hidden("form_name");
     $oFormName->setValue(get_class());
     $oFormName->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oFormName);
     $oPostStep = new Zend_Form_Element_Hidden("post_step");
     $oPostStep->addValidator(new Zend_Validate_GreaterThan(-1));
     $oPostStep->addValidator(new Zend_Validate_LessThan(1));
     $oPostStep->setValue(0);
     $oPostStep->setIgnore(FALSE)->removeDecorator("Label");
     $this->addElement($oPostStep);
     $oTranslation = new Zend_Form_Element_Select("translation");
     $oTranslation->setLabel("Tłumaczenie:");
     $oTranslation->setRequired(TRUE)->setAttrib("class", "valid");
     $oTranslation->addMultiOptions($this->_aAllLang);
     $this->addElement($oTranslation);
     $oMenuId = new Zend_Form_Element_Select("menu_id");
     $oMenuId->setLabel("Menu:");
     $oMenuId->setRequired(TRUE)->setAttrib("class", "valid");
     $oMenuId->addMultiOptions($this->_aAllMenu);
     $this->addElement($oMenuId);
     $this->addElement("hash", "csrf_token", array("ignore" => false, "timeout" => 7200));
     $this->getElement("csrf_token")->removeDecorator("Label");
     $oSubmit = $this->createElement("submit", "choose_site_submit");
     $oSubmit->setLabel("Dalej");
     $this->addElement($oSubmit);
     $oViewScript = new Zend_Form_Decorator_ViewScript();
     $oViewScript->setViewModule("admin");
     $oViewScript->setViewScript("_forms/choosesite.phtml");
     $this->clearDecorators();
     $this->setDecorators(array(array($oViewScript)));
     $oElements = $this->getElements();
     foreach ($oElements as $oElement) {
         $oElement->setFilters($this->_aFilters);
         $oElement->removeDecorator("Errors");
     }
 }
开发者ID:lstaszak,项目名称:zf_zk_aleph,代码行数:40,代码来源:ChooseSite.php

示例13: init

 public function init()
 {
     $this->setTitle('Delete Level')->setDescription('Are you sure you want to delete this level? Members in this level will be re-assigned to the default level.');
     $level_id = new Zend_Form_Element_Hidden('level_id');
     $level_id->addValidator('Int')->addValidator('DbRecordExists', array('table' => Engine_Api::_()->getDbtable('levels', 'authorization'), 'field' => 'level_id'));
     $this->addElements(array($level_id));
     // Buttons
     $this->addElement('Button', 'submit', array('label' => 'Delete Level', 'type' => 'submit', 'ignore' => true, 'decorators' => array('ViewHelper')));
     $this->addElement('Cancel', 'cancel', array('label' => 'cancel', 'link' => true, 'prependText' => ' or ', 'href' => 'admin/levels', 'decorators' => array('ViewHelper')));
     $this->addDisplayGroup(array('submit', 'cancel'), 'buttons');
     $button_group = $this->getDisplayGroup('buttons');
     Engine_Form::setFormElementTypeClasses($this);
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:13,代码来源:Delete.php

示例14: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'frm_multiple_resume');
     $this->setAttrib('name', 'frm_multiple_resume');
     $this->setAttrib('action', BASE_URL . 'candidatedetails/multipleresume');
     $id = new Zend_Form_Element_Hidden('id');
     $id_val = Zend_Controller_Front::getInstance()->getRequest()->getParam('id', null);
     $requisition_id = new Zend_Form_Element_Select("requisition_id");
     $requisition_id->setRegisterInArrayValidator(false);
     $requisition_id->setLabel("Requisition ID");
     $requisition_id->setAttrib("class", "formDataElement");
     $requisition_id->setAttrib('onchange', 'displayParticularCandidates(this,"cand")');
     $requisition_id->setAttrib('title', 'Requisition ID');
     if ($id_val == '') {
         $requisition_id->setRequired(true);
         $requisition_id->addValidator('NotEmpty', false, array('messages' => 'Please select requisition id.'));
     }
     $candidate_firstname = new Zend_Form_Element_Text('candidate_firstname');
     $candidate_firstname->setIsArray(TRUE);
     $candidate_firstname->setAttrib('maxLength', 90);
     $candidate_firstname->setAttrib('title', 'Candidate First Name');
     $candidate_firstname->setAttrib('class', 'candidate_firstname');
     $candidate_firstname->addFilter(new Zend_Filter_StringTrim());
     $candidate_firstname->setRequired(true);
     $candidate_firstname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid candidate first name.')));
     $candidate_lastname = new Zend_Form_Element_Text('candidate_lastname');
     $candidate_lastname->setIsArray(TRUE);
     $candidate_lastname->setAttrib('maxLength', 90);
     $candidate_lastname->setAttrib('title', 'Candidate Last Name');
     $candidate_lastname->setAttrib('class', 'candidate_lastname');
     $candidate_lastname->addFilter(new Zend_Filter_StringTrim());
     $candidate_lastname->setRequired(true);
     $candidate_lastname->addValidator("regex", true, array('pattern' => '/^[a-zA-Z.\\- ?]+$/', 'messages' => array('regexNotMatch' => 'Please enter valid candidate last name.')));
     $candidate_resumes = new Zend_Form_Element_Hidden('cand_resume');
     $candidate_resumes->setIsArray(TRUE);
     $candidate_resumes->setRequired(true);
     $candidate_resumes->addValidator('NotEmpty', false, array('messages' => 'Please select file.'));
     $cand_status = new Zend_Form_Element_Select("cand_status");
     $cand_status->setRegisterInArrayValidator(false);
     $cand_status->setLabel("Status");
     $cand_status->setAttrib("class", "formDataElement");
     $cand_status->setAttrib('title', 'Candidate status');
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'multiple-submit-button');
     $submit->setLabel('Save');
     $this->addElements(array($cand_status, $id, $requisition_id, $candidate_firstname, $candidate_lastname, $candidate_resumes, $submit));
     $this->setElementDecorators(array('ViewHelper'));
 }
开发者ID:rajbrt,项目名称:sentrifugo,代码行数:49,代码来源:Multipleresume.php

示例15: init

 public function init()
 {
     parent::init();
     $this->setAction('/core/session/evaluate/format/html');
     $this->setAttrib('id', 'evaluateform');
     $evaluationId = new Zend_Form_Element_Hidden('session_evaluation_id');
     $evaluationId->addValidator('Int')->addFilter('Null')->setDecorators(array('Composite'));
     $sessionId = new Zend_Form_Element_Hidden('session_id');
     $sessionId->setRequired(true)->addValidator('Int')->setDecorators(array('Composite'));
     $comments = new Zend_Form_Element_Textarea('comments');
     $comments->setLabel('Comments')->setAttrib('class', 'small')->setRequired(true)->setDecorators(array('Composite'));
     $attendees = new Zend_Form_Element_Text('attendees');
     $attendees->setLabel('Attendees')->setAttrib('class', 'tiny')->addValidator('Int')->addFilter('Null')->setRequired(false)->setDecorators(array('Composite'));
     $this->addElements(array($evaluationId, $sessionId, $comments, $attendees));
     $this->addElement('submit', 'submit', array('label' => 'Submit', 'decorators' => $this->_buttonElementDecorator));
 }
开发者ID:br00k,项目名称:tnc-web,代码行数:16,代码来源:Evaluation.php


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