Reputation: 1302
I'm using zend form in a non-zend project and I'm able to access Zend_Form
fine from my custom class Custom_Form
. Then in the file where I want to render my form, I create an instance of my form, but then I'm not sure how to render it.
$form = new Custom_Form();
//how to render the form here
var_dump($form); //var_dump looks busy so couldn't find info from it
Upvotes: 0
Views: 244
Reputation: 20726
This should work, you need an view script and than call the render(); method.
$view = new Zend_View();
$view->doctype('XHTML1_TRANSITIONAL');
$form = new Custom_Form();
$form->setView(new Zend_View());
echo $form->render();
Upvotes: 2