zend - agregar formulario a layout.phtml
AUTOR PREGUNTA #1
-
¿Tienes la misma pregunta? Yo también
Esto también te interesa!
PREGUNTAS SIMILARES
#2
<?php class Form_CrearEmail extends Zend_Form {
public function __construct($options = null) { parent::__construct($options);
$this->setName('createemail');
$title = new Zend_Form_Element_Text('title');
$title->setLabel('Subject')->setRequired(true)->addFilter('StripTags') ->addFilter('StringTrim')->addValidator('NotEmpty');
$info = new Zend_Form_Element_Textarea('info');
$info->setLabel('Email Content')->setAttribs(array('rows' => 12, 'cols' => 79));
$submit = new Zend_Form_Element_Submit('submit');
$submit->setAttrib('id', 'submitbutton'); $this->addElements(array($title, $info, $submit)); } } ?>
Para llamarlo en tu controlador sería de la siguiente manera:
$form = new Form_CrearEmail();
$form->submit->setLabel('Add');
$this->view->form = $form;
Y por último lo despliegas en tu vista de esta forma:
echo $this->form;