View Single Post
  #4 (permalink)  
Old 08-07-2007, 03:06 AM
matias.quaglia's Avatar
matias.quaglia matias.quaglia is offline
Junior Member
 
Join Date: Aug 2007
Posts: 18
Default

Hi Elemental!

Well, I tried to do something like you.

I setted the array in an action, and requested it in another action of the same controller.

To the meanings of this example i created an one-index-dumby-array, storing a md5 of a string.
PHP Code:
    public function init()
    {
        
        
$myArray = array(
            
'hola' => md5('hola')
        );
        
$registry Zend_Registry::getInstance();
        
$registry->set('myArray'$myArray);
    } 
and here I use the array stored in the Registry to pass it to the view:

PHP Code:
    public function indexAction()
    {
        
$this->view->array Zend_Registry::get('myArray');
    } 
And the trivial view:

PHP Code:
print_r($this->array); 
Adn when i reach the example.com/controller/index i get:

Code:
Array ( [hola] => 4d186321c1a7f0f354b297e8914ab240 )
I also tried in the controller that sets the array in registry:

PHP Code:
public function init()
    {
    
        
$myArray = array(
            
'hola' => md5('hola')
        );
        
Zend_Registry::set('myArray'$myArray);
    } 
And also works fine.

May be you need get a closer look to your code, and doublecheck it, just in case...

Cheers, and you forgive me for my bad english
__________________
Matías Quaglia
==========
http://www.matiasquaglia.com.ar
Credo est Creo
Reply With Quote