I'm sure there's some way to make this more pretty by using a temp var or something, but I wanted it to be fast and simple.

Comments

Posted by Alex Peterson (alx) on 2008-03-20T12:17:42.000+0000

OK, this get's rid of the notice but it still doesn't work (it doesn't append to the array still). Any ideas how to make this work right?

Posted by Alex Peterson (alx) on 2008-03-20T14:40:28.000+0000

This should work: First, make sure that Zend_View_Smarty doesn't extend Zend_View_Abstract and then change:

public function __get($key)

to

public function &__get($key)

By passing by reference you no longer have the issues with appending to array's etc. The ArrayObject method i tested above didn't work because Smarty wouldn't iterate over the ArrayObject like an array in my testing.