php - Can't display a Zend Form in my .phtml file -


I am working on a small php application using the Zend Framework, I have used the Zend_Form Has created a form using, but when I try to display it in the browser, it is not working properly.

Here is my form class:

  category IndexForm Extends Zend_Form {public function init ()) {$ this- & gt; SetAction ('main / main'); $ This- & gt; SetMethod ('post'); $ Username = $ this- & gt; AddElement ('text', 'uname', array ('filter' = & gt; array ('string trim', 'stringsolver'), 'validated' => array ('alpha', array ('string lamp' False, array (3,20)),), 'expected' = true, 'label' = & gt; 'username:')); Add ('password', 'pwd', array ('filter' => array ('string' '),' assumptions' => array ('alnum', array ('string lang', false, array) 6, 20)),), 'required' => true, 'label' = & gt; 'password:')); $ Login = $ this- & gt; AddElement ('submit', 'login', array ('required' = & gt; wrong, 'ignore' = & gt; true, 'label' = & gt; 'login',)); }}? & Gt;   

This is my IndexController.php

    

This is my index.phtml , where I need to display the form.

  & lt; Html & gt; & Lt; Style & gt; & Lt; / Style & gt; K & lt; Body & gt; & Lt; Br> & Lt; Img alt = "" src = "http: //localhost/Accounts/application/views/scripts/images/logo.png" width = 200px height = 80px> & Lt ;! - See if you can get the host name Dynamic - & gt; & Lt; Div id = "text" & gt; & Lt; H1 & gt; Welcome to & lt; / H1> & Lt; Br> & Lt; Hour & gt; & Lt; H4 & gt; Please login to view the main page & lt; / H4 & gt; & Lt; / Div & gt; & Lt ;? = $ This- & gt; & Gt; form; & Lt ;! - I want to display the form here - & gt; & Lt; Div & gt; & Lt ;? Php contains APPLICATION_PATH. '/ Visual / script / layout / footer.' & Gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;   

I get the output instead of the form form?

Why is that so? What's wrong with my code? Please help me.

Firstly try

Charu

  & lt ;? Php echo $ this- & gt; Form? & Gt;   

If this works, then you have to disable the short tag by using it

  short_open_tag = 1;    

Comments