I have zend project up and running. How to get zend subform values and save it in a controller?
If I use extends Zend_Form
it's working. But if I use extends Zend_Form_SubForm
it's not showing the form values.
I use the following code in my controller to show the values:
public function registerAction() {
$baseForm = new BaseForm();
$this->view->baseForm = $baseForm;
$request=$this->getRequest();
if ($request->isPost())
{
$baseForm = new BaseForm();
if ($baseForm->isValid( $request->getPost()) ) {
$baseData = array(
'id'=>$baseForm->getValue('id'),
'name'=>$baseForm->getValue('username'),
);
print_r($baseData);
exit;
}
}
}
Any help is greatly appreciated. Thanks in advance.
I am using zend framework 1.12.