How to get values of Zend_registry from one controller to other controller in zend? -
i use following way zend_registry value 1 controller didn't success.should need initiate zend_registry in bootstrap.php or other file can use between 2 files or more.
$registry = zend_registry::getinstance(); $registry->set('variablename', 'value'); or zend_registry::set('variablename', $value); , how value $registry = zend_registry::getinstance(); $registry->get('variablename'); or zend_registry::get('variablename');
to more 1 array
$value = array("name" =>'pankaj',"post" =>'sendeveloper'); zend_registry::get('session')->variablename = $value; $value1 = array("name" =>'rahul',"post" =>'jndeveloper'); zend_registry::get('session')->variabletable = $value; $value3 = array("name" =>'vonod',"post" =>'techdeveloper'); zend_registry::get('session')->variabletech = $value;
it seems work variablename not other. need ?
to solve problem, use zend_registry
and zend_session_namespace
.
in bootstrap:
protected function _initsession() { zend_registry::set('session', new zend_session_namespace("doydoy44")); }
and in usercontroller
:
$value = array("name" =>'pankaj',"post" =>'developer'); zend_registry::get('session')->variablename = $value;
and in customercontroller
:
var_dump(zend_registry::get('session')->variablename);
Comments
Post a Comment