We are going to:
Please consider...
class Application_Form_LoginForm extends Zend_Form { public function init() { $login = new Zend_Form_Element_Text('login'); $login->setLabel('login')->setRequired(true); $passw = new Zend_Form_Element_Password('password'); $passw->setLabel('password')->setRequired(true); $submit = new Zend_Form_Element_Submit('submit'); $submit->setLabel('Login'); $this->setName('login_form') ->setMethod('post') ->setAction('/auth/login') ->addElements(array($login, $passw, $submit)); } }
public function indexAction() { // action body $this->view->login_form = new Application_Form_LoginForm(); }
<?php echo $this->login_form; ?>