On May 1, 2007, at 6:20 AM, Andries Seutens wrote:
Although we aren't using the ZF at work yet, we have similar needs with our "home made" framework. Our framework is based on Smarty, so we have developed a custom plugin, which allows us to dispatch a controller/action from within a template.
Eg in the foo/bar.phtml template we could have something like:
{dispatch controller=customers action=lookup username=andries template=customer/lookup.phtml} this would dispatch the Customers controller with the lookup action, and pass a parameter "username" to it. After the controller action has been dispatched the output will be fetched into the template customer/lookup.phtml.
Whoa... ditto for myself and my company. We actually started off using more of the Complex View approach. But I found that I then had code spread out in page controllers, plus view classes, plus templates and it seemed like too much. We did a rework of our framework and dropped the views clases in favor of just controller/ actions and templates -- where the templates are the view and embedded views were handled the way Andries described. Some of the former view code (adding javascript includes, setting up base template vars) went in the actions in the controller and some went in the templates. Our controller actions are also aware of what context they are being called in. This enables the same actions to be used to render a full page or as a just a piece called via a template plugin and therefore not do all the setup that is normally needed. I think Matthew mentioned that you lose stuff like ACL checks that might have already happened... seems that the Zend_Registry could help with not totally have to re-setup some of this stuff...

On May 1, 2007, at 7:22 AM, Pádraic Brady wrote:
The widget view helper proposal Matthew pointing me to for example is one step forward
So does this do what Andries and I have been doing in our current frameworks? I was searching the proposals and the previous posts in this thread and couldn't find this. Can someone post the link? Sorry if it's totally obvious.
There's nothing in the MVC approach forbidding them from running off to get the Model themselves rather than relying on the Controllers (and all the processes that inevitably involves) to hand feed them.
In fact, some people say that if you don't allow this, it's not MVC: http://www.garfieldtech.com/blog/mvc-vs-pac

On 4/30/07, Cristian Bichis wrote:
I personally just wait to see some commercial applications used now by all
the world (as a vBulletin, or WordPress, aso) but based on ZF...
So maybe we can have some of similar apps based from start on a ZF approach, not made with "goto" :)
Chris Shiflett redid his site recently, http://shiflett.org/about, using Zend Framework and a new open-source blog software called Axi being developed by Grow Collective - http://gr0w.com. I can't find much info about it on their site so I'm not sure if it was built with ZF... but it would be cool if it was.

Overall, it's great how easy it is to extend Zend Framework and do things different ways, but I do find myself wondering if I'm doing it the "right" or "best" way, so I'll definitely try to follow this complex view discussion as close as I can. I think some solution for this should fit in the 80/20 and warrant being part of the framework... but if not... it could be nice to have a centralized place for discussion/review of code like this that is obviously fairly common for certain developers but maybe isn't a core part of the framework.

Thanks,
Rob

Reply via email to