Yes, you should avoid global variables (and global variable work-arounds)
wherever possible.  It creates unnecessary dependencies and can make testing
harder. 

Granted, Zend_Registry could easily be mocked for testing, it's not really
ideal.





sinkingfish wrote:
> 
> Thanks for the rapid reply,
> 
> I thought the registry was more for things like static values, ie configs
> & db connections.
> 
> 
> Jan Pieper-2 wrote:
>> 
>> http://framework.zend.com/manual/en/zend.registry.html
>> 
>>> -----Original Message-----
>>> From: sinkingfish [mailto:sinkingf...@gmail.com] 
>>> Sent: Thursday, December 11, 2008 6:24 PM
>>> To: fw-general@lists.zend.com
>>> Subject: [fw-general] Passing an object between actions.
>>> 
>>> 
>>> Hi,
>>> 
>>> I am looking to pass an object (zend_form to be exact) 
>>> between 2 actions and
>>> am wondering is there a best practice or even a facility in 
>>> zend framework? 
>>> 
>>> I'm considering 3 ways :
>>> 1. make the object a class variable and access using $this
>>> 2. Serialize the the object and pass it as an a parameter in 
>>> the _forward()
>>> method.
>>> 3. make it a global variable.
>>> 
>>> Just wondering did anybody have any thoughts on this.
>>> 
>>> Brian
>>> -- 
>>> View this message in context: 
>>> http://www.nabble.com/Passing-an-object-between-actions.-tp209
>>> 60215p20960215.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>> 
>>> 
>> 
>> 
> 
> 


-----
Regards,

A.J. Brown
Zend Certified PHP Engineer
http://ajbrown.me
-- 
View this message in context: 
http://www.nabble.com/Passing-an-object-between-actions.-tp20960215p20984490.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to