[fw-general] model attached to a view helper

2010-03-30 Thread My Lists
Hello people, check out this example found at : http://framework.zend.com/manual/en/performance.view.html class My_View_Helper_BugList extends Zend_View_Helper_Abstract {     public function bugList()     {         $model = new Bug();         $html  = ul\n;         foreach ($model-fetchActive()

Re: [fw-general] model attached to a view helper

2010-03-30 Thread Cameron
I frequently pass full model instances through to my views and retrieve information from them, but I don't write code in the models that is specifically used for display purposes - as an example, if there's a method calculateOutstandingBalance(), it's just going to return a float, it's the exact

Re: [fw-general] model attached to a view helper

2010-03-30 Thread Chris Morrell
The example warns about calling action() which has to clone half the dispatch process, dispatch a new action, grab the response body and return it. Obviously that's a pretty expensive call. That said, I have to agree with the commenter. You could get a similar result with: class