comment.php

来自「Bug tracker, and reporter.」· PHP 代码 · 共 44 行

PHP
44
字号
<?phpclass Form_Comment extends Zend_Form{		public function __construct($options = null){				parent::__construct($options);		$this->setName('comment');		$titre = new Zend_Form_Element_Text('titre');		$titre -> setLabel('Titre')		->setRequired(true)		->addValidator('NotEmpty');				$contenu = new Zend_Form_Element_Textarea('contenu',array('rows' => '6','cols' => '60'));		$contenu -> setLabel('Commentaire')		->setRequired(true)		->addValidator('NotEmpty');				$submit = new Zend_Form_Element_Submit('submit');		$submit->setLabel('Envoyer le commentaire');		$this->addElements(array( $titre, $contenu, $submit));		$this->clearDecorators();		$this->addDecorator('FormElements')		->addDecorator('HtmlTag', array('tag' => '<fieldset>'))		->addDecorator('Form');		$this->setElementDecorators(array(		array('ViewHelper'),		array('Errors',array('class'=>'error')),		array('Label', array('separator'=>' ')),		array('HtmlTag', array('tag' => 'p', 'class'=>'form_element')),		));		// buttons do not need labels		$submit->setDecorators(array(		array('ViewHelper'),		array('HtmlTag', array('tag' => 'p', 'class'=>'submit')),		));	}}?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?