Carolina Feher da Silva schrieb:
> Please paste this code in a view:
> 
> $this->a = array();
> $this->a[] = 1;
> print_r($this->a);
> 
> What do you get? I get an *empty* array. How come? I don't understand it.

I already found this issue and reported a bug:
http://framework.zend.com/issues/browse/ZF-298
There is also a second ticket concerning this issue:
http://framework.zend.com/issues/browse/ZF-460

In ZF-298 I posted a solution suggestion, but as of PHP 5.2 with or
without the fix the syntax you used will not work anymore. So if you
want to assign an array to a Zend_View object, first build your array
completely elsewhere then assign it to the Zend_View object.
Alternatively you can assign an object to $this->a, i.e. an instance of
ArrayObject.


Gunar

Reply via email to