problem with displaying the Form
HI
I开发者_如何学运维 am trying to get the view using the following:
$this->getView()->form = $form;
but still I do not get the form design viewed I cross checked for form design with this code
include_once 'Zend/View.php';
$view = new Zend_View;
$form->setView($view);
echo $form;
and it worked so plz let me know how can I get the design displayed using this :
$this->getView()->form = $form;
Regards kiran
Where are you trying this code?
What is the context?
If you're trying to use Zend_Form as a standalone component, you must set manually the view object, it's what you do with $form->setView(new Zend_View());
, however, if you use the classic MVC implantation of Zend Framework, the view object will be loaded using the one defined by your application.
So be sure to have either a view object initialized in your Bootstrap.php
or in your config.ini
精彩评论