the thing in this case is i need to be able to turn it on or off depending on
the module. only the admin module inherits the core functionality.
the code itself there was the most appropriate solution i could find on the
zend framework wiki (in the mvc exceptions section). do you think it would
be cleaner to handle this with a controller plugin that validated the
existence of the action?
Federico Cargnelutti wrote:
>
> Oh yes, I'm a big fan of Symfony. A quote from their site:
>
> "An alternative action syntax is available to dispatch the actions in
> separate files, one file per action. In this case, each action class
> extends sfAction (instead of sfActions) and is named actionNameAction. The
> actual action method is simply named execute. The file name is the same as
> the class name."
>
> For example:
>
> class Modules_Blog extends Zend_Controller_Action {
> }
>
> class Modules_Blog_Action_Edit extends Modules_Blog {
> }
>
> class Modules_Blog_Action_Add extends Modules_Blog {
> }
>
> This might look pointless at first sight, but when you have developers
> creating action controllers that have more than 2.000 lines of code and
> you need to refactor a class, this is a great solution.
>
> Digitalus, that's an interesting hack, but if I were you I'd add this as a
> new functionality to the Zend_Controller_Dispatcher_Standard class rather
> than having to duplicate your code all over the app.
>
>
>
> Albuquerque Rui wrote:
>>
>> Looks like symfony framework. It uses the same solution ton handle
>> actions.
>>
>> 2007/12/10, Federico Cargnelutti <[EMAIL PROTECTED]>:
>>>
>>>
>>> Hi, check out this message:
>>>
>>>
>>> http://www.nabble.com/Re%3A-Using-Zend_Config---Changing-a-module-behaviour-p14136772s16154.html
>>>
>>>
>>> digitalus_media wrote:
>>> >
>>> > i want to add a layer to my cms that will allow myself and other
>>> > developers to add custom logic to their sites core functionality and
>>> > look-feel without hampering updates.
>>> >
>>> > I have a few ideas that i have played with that are working fairly
>>> well,
>>> > but would really appreciate any input on a more elegant solution.
>>> >
>>> > my solution basically has a core module and a cms module (among
>>> others).
>>> > the cms module has all of the same controllers as the core module, but
>>> > each of them simply extend the core controller.
>>> >
>>> > the pro of this approach as i see it is everything still works the way
>>> a
>>> > zf developer would expect and that the developer has the option at any
>>> > time to either use an existing action or add their own (which could
>>> run
>>> on
>>> > its own or could inject some logic, then call the parent action).
>>> >
>>> > i have also considered a controller plugin that would evaluate that
>>> the
>>> > module / controller / action / view exist, and if not redirect the
>>> request
>>> > to the core module.
>>> >
>>> > any input is much appreciated!!!!
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/best-practice-for-overriding-controllers-tp14230636s16154p14247534.html
>>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/best-practice-for-overriding-controllers-tp14230636s16154p14264428.html
Sent from the Zend Framework mailing list archive at Nabble.com.