issue with zend form element displaying -
please check code below, problem no form element displayed in test action not able locate
test.php-->form class
class application_form_test extends zend_form { public $t_fileup; public $t_submit; /*function init * initialise elements * */ public function _init() { $this->t_fileup=new zend_form_element_text('image'); //$this->t_fileup->setdestination(uploads); $this->t_submit=new zend_form_element_submit('add'); } /*function generate form specific function * */ public function generateform() { return $this->addelements(array($this->t_fileup,$this->t_submit)); } }
testaction
public function testaction() { $objform=new application_form_test(); $forms=$objform->generateform(); $this->view->form=$forms; }
test.phtml
<?php //echo $this->nm; echo $this->form->image; ?>
the function name hook wrong (no "_"):
use:
public function init() { $this->t_fileup=new zend_form_element_text('image'); //$this->t_fileup->setdestination(uploads); $this->t_submit=new zend_form_element_submit('add'); }
Comments
Post a Comment