Thursday, June 28, 2012

Re: Is there a lighter weight alternative to requestAction?

That's the dilemma we are facing. The traditional MVC paradigm where a URL maps to a controller and action is fine for simple sites, but for more complex sites the model falls apart. Our site started as a straightforward MVC design, but then the users wanted to add their own landing pages and control what appears on each page. It is not practical to create a new controller/action/view for each new landing page so the site became a hybrid of traditional MVC and a CMS with the ability to embed active content.

@Florian, that's essentially what we are doing. For the updated design, we are routing all requests to a single controller/action/view and using a Helper to embed modules in the content. The module positions are represented by tokens in the content, so we don't know which modules to load until rendering the view. As most of the modules are active content we need to use requestAction to assemble the module content from data in the database and render in the view. Because requestAction loads a new environment it adds a significant overhead especially when loading a lot of modules. And it also involves a bit of a kludge to change the routing on the fly. It is working, but I feel it could be done in a cleaner, simpler, more efficient way, but I am struggling how to figure out how to do that and stay within the Cake paradigm.

Mark

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: