Re: [fw-general] MVC design question

2010-10-30 Thread Jurian Sluiman
On Saturday 30 Oct 2010 09:50:56 Marian Meres wrote: > If the duplication is isolated to that particular controller only, why > not just simply create a "no action" method to be called in those two > actions... the controller is still just a regular class. > > m. For me, it's more clean for a con

Re: [fw-general] MVC design question

2010-10-30 Thread Christian Riesen
Marian has brought it to the point. Simply create a function that does the same thing over and over. I have created an abstraction of the controller which I extend for all controllers and in that have a function that goes a bit like this. No guarantees as it's stripped down from a slightly more in

Re: [fw-general] MVC design question

2010-10-30 Thread Marian Meres
If the duplication is isolated to that particular controller only, why not just simply create a "no action" method to be called in those two actions... the controller is still just a regular class. m. On Sat, Oct 30, 2010 at 12:41 AM, Hector Virgen wrote: > You can probably place that common cod

Re: [fw-general] MVC design question

2010-10-29 Thread Hector Virgen
You can probably place that common code in your preDispatch() hook: if ($article = $this->_request->getParam('article')) { // Load article and assign to view } -- *Hector Virgen* Sr. Web Developer http://www.virgentech.com On Fri, Oct 29, 2010 at 3:32 PM, debussy007 wrote: > > Hi, > > Th

[fw-general] MVC design question

2010-10-29 Thread debussy007
Hi, That's a recurring problem I have had for a long time : Let's say I have an action allowing to view an article, and an action allowing to edit an article. To setup the views, the code is the same for both actions (get the article id from GET parameter, fetch article, execute some checks, a