📄 projet.php
字号:
<?phpclass Form_Projet extends Zend_Form{ public function __construct($options = null,$edit = null){ parent::__construct($options); $this->setName('projet'); $nom = new Zend_Form_Element_Text('nom'); $nom -> setLabel('Nom') ->setRequired(true) ->setValue($edit['nom']); $nom-> addValidator('NotEmpty'); $description = new Zend_Form_Element_Textarea('description',array('rows' => '6','cols' => '60')); $description -> setLabel('Description') ->setRequired(true) ->setValue($edit['description']); $description->addValidator('NotEmpty'); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel($edit['submit']); $this->addElements(array($nom, $description, $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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -