1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
public function init()
{
$this->setName('projet');
$decorators = array(
'ViewHelper',
'Errors',
array('Description', array('tag' => 'p', 'class' => 'description')),
array('HtmlTag', array('tag' => 'td')),
array('Label', array('tag' => 'th')),
array(array('tr' => 'HtmlTag'), array('tag' => 'tr'))
);
$id = new Zend_Form_Element_Hidden('id');
$id->setDecorators(array());
$id->addFilter('Int');
$intitule = new Zend_Form_Element_Text('intitule');
$intitule->setLabel('Intitule')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty')
->setDecorators(array('label'))
->setDecorators($decorators);
$lien = new Zend_Form_Element_Text('lien');
$lien->setLabel('Lien')
->setRequired(false)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty')
->setDecorators($decorators);
$description = new Zend_Form_Element_Text('description');
$description->setLabel('Description')
->setRequired(true)
->addFilter('StripTags')
->addFilter('StringTrim')
->addValidator('NotEmpty')
->setDecorators($decorators);
$envoyer = new Zend_Form_Element_Submit('envoyer');
$envoyer->setAttrib('id', 'boutonenvoyer');
$envoyer->setLabel('Proposer');
$envoyer->setDecorators(array('ViewHelper',array(array('td' => 'HtmlTag'), array('tag' => 'td', 'colspan' => 2)),array(array('tr' => 'HtmlTag'), array('tag' => 'tr'))));
$this->addElements(array($id, $intitule, $lien, $description, $envoyer));
$this->setDecorators(
array(
'FormElements',
array('HtmlTag', array('tag' => 'table')),
'Form'
)
);
} |
Partager