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


PHP Zend_Form_Element_Hash::addDecorator方法代码示例

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


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

示例1: replyForm

 /**
  * Build replyForm
  *
  * @return void
  */
 protected function replyForm()
 {
     $this->setName('replyForm')->setElementsBelongTo('replyForm');
     $element = new Zend_Form_Element_Text('subject', array('disableLoadDefaultDecorators' => true));
     $element->addDecorator('ViewHelper')->setAttribs(array('class' => 'input-title', 'maxlength' => 126, 'tabindex' => 1))->addFilter('StripTags')->addFilter('StringTrim');
     $this->addElement($element);
     $element = new Zend_Form_Element_Textarea('body', array('disableLoadDefaultDecorators' => true));
     $element->addDecorator('ViewHelper')->setRequired(true)->addErrorMessage('Message cannot be empty!')->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
     $this->addElement($element);
     $element = new Zend_Form_Element_Hash('token', array('disableLoadDefaultDecorators' => true));
     $element->addDecorator('ViewHelper')->addErrorMessage('Form must not be resubmitted');
     $this->addElement($element);
     $element = new Zend_Form_Element_Submit('replySubmit', array('disableLoadDefaultDecorators' => true));
     $element->addDecorator('ViewHelper')->setLabel('Post Reply');
     $this->addElement($element);
     $element = new Zend_Form_Element_Reset('reset', array('disableLoadDefaultDecorators' => true));
     $element->addDecorator('ViewHelper')->setLabel('Reset');
     $this->addElement($element);
     $this->clearDecorators();
     $this->addDecorator('FormElements')->addDecorator('Form');
     /*
     		$this->setName('replyForm')
     			->setElementsBelongTo('replyForm')
     			->setMethod('post')
     			->setEnctype('application/x-www-form-urlencoded');
     
     		$subject = new Zend_Form_Element_Text('subject');
     		$subject->setLabel('Post Subject')
     			->setAttribs(array('class' => 'input-title', 'maxlength' => 126))
     			->setRequired(true)
     			->addFilter('StripTags')
     			->addFilter('StringTrim')
     			->addValidator('NotEmpty');
     
     		$message = new Zend_Form_Element_Textarea('message');
     		$message->setLabel('Your Message')
     			->setRequired(true)
     			->addFilter('StripTags')
     			->addFilter('StringTrim')
     			->addValidator('NotEmpty');
     
     		$posthash = new Zend_Form_Element_Hash('token');
     
     		$submit = new Zend_Form_Element_Submit('forumSubmit');
     		$submit->setLabel('Post Reply');
     
     		$this->addElements(array($subject, $message, $posthash, $submit));
     */
 }
开发者ID:nuxwin,项目名称:i-PMS,代码行数:54,代码来源:Thread.php


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