View Single Post
  #7 (permalink)  
Old 08-16-2007, 01:39 AM
GeniusTse GeniusTse is offline
Junior Member
 
Join Date: Aug 2007
Posts: 10
Default Elemental Thank you for your reply

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
Reply With Quote