On Mon, 30 Jun 2008, Tobias Schlitt wrote: > On 06/30/2008 11:52 AM Derick Rethans wrote: > > On Mon, 30 Jun 2008, Tobias Schlitt wrote: > >> On 06/30/2008 12:42 AM James Pic wrote: > >>> Tobias Schlitt wrote: > > >>>> ezcMvcRequestFilter > >>>> ------------------- > >>>> > >>>> The filters are described to be used in a method named > >>>> ezcMvcController->runRequestFilters(), while this method should be > >>>> called by ezcMvcController->run(). It does make little sense to me to > >>>> mention that a method ezcMvcController->runRequestFilters() should be > >>>> implemented at all, if the controller calls the filter itself. > >>>> > >>>> Instead I would suggest to design it in either of the following ways: > >>>> > >>>> a) Remove the ezcMvcController->runRequestFilters() part and just > >>>> mention that filters should be run by the controller. > >>>> b) Require the method ezcMvcController->runRequestFilters() in the > >>>> interface and make it be run by the request builder. > >>> Don't you mean that the request maker should run the filters? > >>> Should the selection of filters depend on the controller or the request > >>> builder? > > >> The object running the controller should do it. :) > > > That poses a problem. It means that the filter selection now has to be > > done in the dispatcher, where it clearly belongs to the controller. It > > also means that might you have to implement the filter chains multiple > > times. > > No, the dispatcher just issues the filtering methods, instead of leaving > this to the controllers run() method. Dispatcher code: > > // ... create request and controller > > $controller->runRequestFilers( $request ); > $result = $controller->run( $request ); > $controller->runResultFilters( $result ); > > // view handling...
But why do you want this? There is no reason why the dispatcher should do this, as it can all be done in the run() method. The abstract ezcMvcController class provides the run() method, that in order: runs the request filters, figures out which action to call from the request object (with a "findAction( $request )" method ), runs the action with its parameters and then runs the result filters. The run() method you should not have to overload yourself - and thus the filters are always run - so why do you want to do this in the dispatcher instead? regards, Derick -- Components mailing list Components@lists.ez.no http://lists.ez.no/mailman/listinfo/components