2008年12月5日星期五

Re: [fw-mvc] Persistence of view helpers

2008/12/5 Matthew Weier O'Phinney <matthew@zend.com>
-- Giorgio Sironi <piccoloprincipeazzurro@gmail.com> wrote
(on Friday, 05 December 2008, 05:30 PM +0100):

We have a number of view helpers in the standard distribution that have
similar needs. The solution we found was to return the helper instance
when no arguments are passed to the helper:
 
Very nice... Zend_View_Abstract:1068, method _getPlugin() is:
            $store[$name] = new $class();
so no constructor injection is possible; the only way is a setter injection (I love testable code). Thanks.

--
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://www.sourceforge.net/projects/ossigeno

没有评论: