Here is my code, thank you ~
These code in a single controller class called TestController
PHP Code:
// Write a variable into registry
public function registryInAction()
{
$value = '123';
$registry = new Zend_Registry(array('index' => $value));
Zend_Registry::setInstance($registry);
echo <<<EOH
yoyo variable index has been registered!!<br />
EOH;
// get the index from registry
$registry = Zend_Registry::getInstance();
var_dump( $registry['index'] );
$this->_helper->viewRenderer->setNoRender();
}
Output: yoyo variable index has been registered!!
string(3) "123"
PHP Code:
// Try to read the value from registry
public function registryOutAction()
{
// get the index from registry
$registry = Zend_Registry::getInstance();
var_dump( $registry['index'] );
$this->_helper->viewRenderer->setNoRender();
}
Output: NULL
do my codes have any mistake