本文整理汇总了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));
*/
}