I have complex html form with 10 tabs on my site. When user goes to the page with form method getFormAction() is called
public function getFormAction()
{
$productId = $this->_getParam('productId');
if (!empty($productId)) {
//Get model and populate form
//...
$form = new Form_OnixProduct2();
$form->populate($model);
} else {
$form = new Form_OnixProduct2();
}
$currentFeedFormSession = new Zend_Session_Namespace('currentFeedSession');
$currentFeedFormSession->form = $form;
$this->view->form = $form;
}
}
In this action I initialised Zend_Form, save it to the session variable and in the view I will output only one first tab. All other tabs are displayed using ajax requests - with a call to the action outputOnixTabAction
public function outputOnixTabAction()
{
$this->_helper->layout->disableLayout();
$tabName = $this->_getParam('tabName');
$currentFeedFormSession = new Zend_Session_Namespace('currentFeedSession');
$this->view->form = $currentFeedFormSession->form;
$this->view->tabName = $tabName;
}
My problem is that only first tab is displayed. When I make ajax requests for displaying other tabs I receive the following error:
Message: Zend_Session::start() - /otms/vendor/zendframework/zendframework1/library/Zend/Loader.php(Line:134): Error #2 include_once(): Failed opening 'Zend/View/Helper/OutputComplexForm.php' for inclusion
Though this helper is successfully loaded in the first tab view. Zend_Session::start() start is called in my custom controller plugin - for every request I check user role with the following code:
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity()) {
$userRole = $auth->getIdentity()->user_type;
} else {
$userRole = 'guest';
}
and hasIdentity() function leads to Zend_Session::start(true) command in Zend/Session/Namespace.php file line 143.
If you have any ideas please share with me.
UPD
Here is an autoloader part from my bootstrap:
protected function _initAutoload()
{
$loader = new Zend_Application_Module_Autoloader(
array(
'namespace' => '',
'basePath' => APPLICATION_PATH
)
);
return $loader;
}
UPD 2
Also I've found out that if I rename helper class from
Zend_View_Helper_OutputComplexForm
to
My_View_Helper_OutputComplexForm
and add line
resources.view.helperPath.My_View_Helper = APPLICATION_PATH "/views/helpers"
to application.ini file everything works fine. But I don't get what it's so special in Zend_ prefix?