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


PHP Zend_Form_Element_Submit::clearDecorators方法代码示例

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


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

示例1: init

 public function init()
 {
     $this->clearDecorators();
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'append', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'li')));
     $oldpassword = new Zend_Form_Element_Password('oldpassword');
     $oldpassword->setLabel('Your old password: ');
     $oldpassword->setRequired(true)->addValidator('RightPassword')->addFilters(array('StripTags', 'StringTrim'));
     $oldpassword->setDecorators($decorators);
     $password = new Zend_Form_Element_Password("password");
     $password->setLabel("New password:")->addValidator("NotEmpty")->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->setDecorators($decorators)->addValidator('IdenticalField', false, array('password2', ' confirm password field'));
     // identical field validator with custom messages
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $password2 = new Zend_Form_Element_Password("password2");
     $password2->setLabel("Confirm password:")->addValidator("NotEmpty")->addFilters(array('StripTags', 'StringTrim'))->setRequired(true)->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->clearDecorators();
     $submit->addDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div', 'class' => 'submit'))));
     $submit->setAttrib('class', 'large')->setLabel('Change password');
     $this->addElement($submit);
     $this->addElements(array($oldpassword, $password, $password2, $submit));
     $this->addDisplayGroup(array('oldpassword', 'password', 'password2'), 'userdetails');
     $this->addDecorator('FormElements')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'))->addDecorator('FieldSet')->addDecorator('Form');
     $this->userdetails->removeDecorator('DtDdWrapper');
     $this->userdetails->removeDecorator('FieldSet');
     $this->userdetails->addDecorator(array('DtDdWrapper' => 'HtmlTag'), array('tag' => 'ul'));
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->setLegend('Edit account details: ');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:32,代码来源:ChangePasswordForm.php

示例2: init

 public function init()
 {
     $required = true;
     $roles = new Roles();
     $role_options = $roles->getRoles();
     $inst = new Institutions();
     $inst_options = $inst->getInsts();
     $this->setAction($this->_actionUrl)->setMethod('post')->setAttrib('id', 'accountform');
     $this->clearDecorators();
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'li')));
     $username = $this->addElement('text', 'username', array('label' => 'Username: '))->username;
     $username->setDecorators($decorators)->addFilters(array('StripTags', 'StringTrim'))->setRequired(true);
     $firstName = $this->addElement('text', 'first_name', array('label' => 'First Name', 'size' => '30'))->first_name;
     $firstName->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('You must enter a firstname');
     $firstName->setDecorators($decorators);
     $lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name', 'size' => '30'))->last_name;
     $lastName->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('You must enter a surname');
     $lastName->setDecorators($decorators);
     $fullname = $this->addElement('text', 'fullname', array('label' => 'Preferred Name: ', 'size' => '30'))->fullname;
     $fullname->setRequired(true)->addFilters(array('StripTags', 'StringTrim'))->addValidator('Alnum', false, array('allowWhiteSpace' => true))->addErrorMessage('You must enter your preferred name');
     $fullname->setDecorators($decorators);
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->addFilters(array('StripTags', 'StringTrim', 'StringToLower'))->setRequired(true)->addErrorMessage('Please enter a valid address!');
     $email->setDecorators($decorators);
     $password = $this->addElement('password', 'password', array('label' => 'Change password: ', 'size' => '30'))->password;
     $password->setRequired(false);
     $password->setDecorators($decorators);
     $institution = $this->addElement('select', 'institution', array('label' => 'Recording institution: '))->institution;
     $institution->setDecorators($decorators);
     $institution->addMultiOptions(array(NULL => NULL, 'Choose institution' => $inst_options));
     $role = $this->addElement('select', 'role', array('label' => 'Site role: '))->role;
     $role->setDecorators($decorators);
     $role->addMultiOptions(array(NULL => NULL, 'Choose role' => $role_options));
     $person = $this->addElement('text', 'person', array('label' => 'Personal details attached: '))->person;
     $person->setDecorators($decorators);
     $peopleID = $this->addElement('hidden', 'peopleID', array())->peopleID;
     $peopleID->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->clearDecorators();
     $submit->addDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div', 'class' => 'submit'))));
     $submit->setAttrib('class', 'large');
     $this->addElement($submit);
     $hash = new Zend_Form_Element_Hash('csrf');
     $hash->setValue($this->_config->form->salt)->removeDecorator('DtDdWrapper')->removeDecorator('HtmlTag')->removeDecorator('label')->setTimeout(60);
     $this->addElement($hash);
     $this->addDisplayGroup(array('username', 'first_name', 'last_name', 'fullname', 'email', 'institution', 'role', 'password', 'person', 'peopleID'), 'userdetails');
     $this->addDecorator('FormElements')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'))->addDecorator('FieldSet')->addDecorator('Form');
     $this->userdetails->removeDecorator('DtDdWrapper');
     $this->userdetails->removeDecorator('FieldSet');
     $this->userdetails->addDecorator(array('DtDdWrapper' => 'HtmlTag'), array('tag' => 'ul'));
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->setLegend('Edit account details: ');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:55,代码来源:EditAccountForm.php

示例3: init

 public function init()
 {
     $required = true;
     $this->setAction($this->_actionUrl)->setMethod('post')->setAttrib('id', 'accountform');
     $this->clearDecorators();
     $this->addElementPrefixPath('Pas_Validate', 'Pas/Validate/', 'validate');
     $this->addPrefixPath('Pas_Form_Element', 'Pas/Form/Element/', 'element');
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'li')));
     $username = $this->addElement('text', 'username', array('label' => 'Username: '))->username;
     $username->setDecorators($decorators)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('StringLength', true, array('max' => 40))->setRequired(true);
     $username->getValidator('StringLength')->setMessage('Username is too long');
     $password = $this->addElement('password', 'password', array('label' => 'Password'))->password;
     $password->addValidator('StringLength', true, array(6))->addValidator('Regex', true, array('/^(?=.*\\d)(?=.*[a-zA-Z]).{6,}$/'))->setRequired(true)->addErrorMessage('Please enter a valid password!');
     $password->getValidator('StringLength')->setMessage('Password is too short');
     $password->getValidator('Regex')->setMessage('Password does not contain letters and numbers');
     $password->setDecorators($decorators);
     $firstName = $this->addElement('text', 'first_name', array('label' => 'First Name', 'size' => '30'))->first_name;
     $firstName->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('You must enter a firstname');
     $firstName->setDecorators($decorators);
     $lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name', 'size' => '30'))->last_name;
     $lastName->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('You must enter a surname');
     $lastName->setDecorators($decorators);
     $fullname = $this->addElement('text', 'fullname', array('label' => 'Preferred Name: ', 'size' => '30'))->fullname;
     $fullname->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addErrorMessage('You must enter your preferred name');
     $fullname->setDecorators($decorators);
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('EmailAddress')->setRequired(true)->addFilter('StringToLower')->addFilter('StringTrim')->addFilter('StripTags')->addErrorMessage('Please enter a valid address!');
     $email->setDecorators($decorators);
     $institution = $this->addElement('text', 'institution', array('label' => 'Recording institution: ', 'size' => '30'))->institution;
     $institution->setDecorators($decorators);
     $researchOutline = $this->addElement('textArea', 'research_outline', array('label' => 'Outline your research', 'rows' => 10, 'cols' => 40))->research_outline;
     $researchOutline->setRequired(false)->addFilter('HtmlBody')->addFilter('EmptyParagraph');
     $reference = $this->addElement('text', 'reference', array('label' => 'Please provide a referee:', 'size' => '40'))->reference;
     $reference->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim');
     $reference->setDecorators($decorators);
     $referenceEmail = $this->addElement('text', 'reference_email', array('label' => 'Please provide an email address for your referee:', 'size' => '40'))->reference_email;
     $referenceEmail->setRequired(false)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('EmailAddress');
     $referenceEmail->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Set my account up on Beowulf');
     $submit->clearDecorators();
     $submit->addDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div', 'class' => 'submit'))));
     $submit->setAttrib('class', 'large');
     $this->addElement($submit);
     $this->addDisplayGroup(array('username', 'password', 'first_name', 'last_name', 'fullname', 'email', 'institution', 'research_outline', 'reference', 'reference_email'), 'userdetails');
     $this->addDecorator('FormElements')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'))->addDecorator('FieldSet')->addDecorator('Form');
     $this->userdetails->removeDecorator('DtDdWrapper');
     $this->userdetails->removeDecorator('FieldSet');
     $this->userdetails->addDecorator(array('DtDdWrapper' => 'HtmlTag'), array('tag' => 'ul'));
     $this->addDisplayGroup(array('submit'), 'submit');
     $this->setLegend('Edit account details: ');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:52,代码来源:AccountForm.php

示例4: init

 public function init()
 {
     $required = true;
     $copyrights = new Copyrights();
     $copy = $copyrights->getStyles();
     $this->setAction($this->_actionUrl)->setMethod('post')->setAttrib('id', 'accountform');
     $this->clearDecorators();
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'requiredSuffix' => ' *', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'li')));
     $username = $this->addElement('text', 'username', array('label' => 'Username:'))->username;
     $username->setDecorators($decorators)->Disabled = true;
     $username->addFilters(array('StringTrim', 'StripTags'));
     $firstName = $this->addElement('text', 'first_name', array('label' => 'First Name: ', 'size' => '30'))->first_name;
     $firstName->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a firstname');
     $firstName->setDecorators($decorators);
     $lastName = $this->addElement('text', 'last_name', array('label' => 'Last Name: ', 'size' => '30'))->last_name;
     $lastName->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter a surname');
     $lastName->setDecorators($decorators);
     $fullname = $this->addElement('text', 'fullname', array('label' => 'Preferred Name: ', 'size' => '30'))->fullname;
     $fullname->setRequired(true)->addFilters(array('StringTrim', 'StripTags'))->addErrorMessage('You must enter your preferred name');
     $fullname->setDecorators($decorators);
     $email = $this->addElement('text', 'email', array('label' => 'Email Address', 'size' => '30'))->email;
     $email->addValidator('emailAddress')->setRequired(true)->addErrorMessage('Please enter a valid address!')->addFilters(array('StringTrim', 'StripTags', 'StringToLower'))->addValidator('EmailAddress', false, array('mx' => true));
     $email->setDecorators($decorators);
     $password = $this->addElement('password', 'password', array('label' => 'Change password: ', 'size' => '30'))->password;
     $password->addFilters(array('StringTrim', 'StripTags'))->setRequired(false);
     $password->setDecorators($decorators);
     $copyright = $this->addElement('select', 'copyright', array('label' => 'Default copyright: '))->copyright;
     $copyright->setRequired(TRUE);
     $copyright->addMultiOptions(array(NULL => 'Select a licence holder', 'Valid copyrights' => $copy))->addValidator('InArray', false, array(array_keys($copy)))->setDecorators($decorators);
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Save details');
     $submit->clearDecorators();
     $submit->addDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div', 'class' => 'submit'))));
     $submit->setAttrib('class', 'large');
     $this->addElement($submit);
     $this->addDisplayGroup(array('username', 'first_name', 'last_name', 'fullname', 'email', 'password', 'copyright'), 'userdetails');
     $this->addDecorator('FormElements')->addDecorator(array('ListWrapper' => 'HtmlTag'), array('tag' => 'div'))->addDecorator('FieldSet')->addDecorator('Form');
     $this->setLegend('Edit your account and profile details: ');
     $this->userdetails->removeDecorator('DtDdWrapper');
     $this->userdetails->removeDecorator('HtmlTag');
     $this->userdetails->removeDecorator('FieldSet');
     $this->userdetails->addDecorator(array('DtDdWrapper' => 'HtmlTag'), array('tag' => 'ul'));
     $this->addDisplayGroup(array('submit'), 'submit');
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:44,代码来源:ProfileForm.php

示例5: __construct

 public function __construct($options = null)
 {
     parent::__construct($options);
     $this->setAttrib('accept-charset', 'UTF-8');
     $this->clearDecorators();
     $decorators = array(array('ViewHelper'), array('Description', array('placement' => 'append', 'class' => 'info')), array('Errors', array('placement' => 'prepend', 'class' => 'error', 'tag' => 'li')), array('Label', array('separator' => ' ', 'class' => 'leftalign')), array('HtmlTag', array('tag' => 'div')));
     $this->setName('workflow');
     $id = new Zend_Form_Element_Hidden('id');
     $id->removeDecorator('label');
     $wfstage = new Zend_Form_Element_Radio('wfstage');
     $wfstage->setRequired(false)->addMultiOptions(array('1' => 'Quarantine', '2' => 'Review', '4' => 'Validation', '3' => 'Published'))->addFilter('StripTags')->addFilter('StringTrim')->setDecorators($decorators);
     //Submit button
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setAttrib('id', 'submitbutton');
     $submit->clearDecorators();
     $submit->addDecorators(array(array('ViewHelper'), array('HtmlTag', array('tag' => 'div', 'class' => 'submit'))));
     $this->setLegend('Workflow status');
     $this->addDecorator('FormElements')->addDecorator('Form')->addDecorator('Fieldset');
     $this->addElements(array($id, $wfstage, $submit));
 }
开发者ID:rwebley,项目名称:Beowulf---PAS,代码行数:20,代码来源:WorkflowStageForm.php

示例6: addSubmitElement

 public function addSubmitElement()
 {
     require_once 'Zend/Form/Element/Submit.php';
     $submit = new Zend_Form_Element_Submit($this->getSubmitParam(), $this->getTranslator()->translate('accountLoginFormSubmitButton'));
     $submit->clearDecorators()->addDecorator('viewHelper');
     $this->addElement($submit);
     return $this;
 }
开发者ID:sitengine,项目名称:sitengine,代码行数:8,代码来源:LoginForm.php


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