konto usunięte
Temat: Zend_Form nie widać formularza
Mam mały problem, stworzyłem w Zendzie formularz:
<?php class forms_ContactForm extends Zend_Form
{
public function __construct($options = null)
{
parent::__construct($options);
$this->setName('contact_us');
$title = new Zend_Form_Element_Select('title');
$title->setLabel('Title')
->setMultiOptions(array('mr'=>'Mr', 'mrs'=>'Mrs'))
->setRequired(true)->addValidator('NotEmpty', true);
$firstName = new Zend_Form_Element_Text('firstName');
$firstName->setLabel('First name')
->setRequired(true)
->addValidator('NotEmpty');
$lastName = new Zend_Form_Element_Text('lastName');
$lastName->setLabel('Last name')
->setRequired(true)
->addValidator('NotEmpty');
$email = new Zend_Form_Element_Text('email');
$email->setLabel('Email address')
->addFilter('StringToLower')
->setRequired(true)
->addValidator('NotEmpty', true)
->addValidator('EmailAddress');
$submit = new Zend_Form_Element_Submit('submit');
$submit->setLabel('Contact us');
$this->addElements(array($title, $firstName,
$lastName, $email, $submit));
}
}
I problem jest taki, że nie działa mi on, w kontrolerze mam taki kod:
$form = new forms_ContactForm();
$this->view->form = $form;
W widoku wiadomo echo $this->form; efekt jest taki, że nic nie widać.
Formularz mam wgrany w application/formsPaweł Cyrklaf edytował(a) ten post dnia 30.11.10 o godzinie 18:31