[Catalyst] RFC: Catalyst::Plugin::AutoValidate

Kieren Diment diment at gmail.com
Wed Apr 9 11:26:10 BST 2008


On 9 Apr 2008, at 20:07, Markus Holzer wrote:
> Moritz Onken schrieb:
>> But is it really a plugin? I'd prefer to use it as a controller  
>> base class because it is controller specific. This way you could  
>> chose which controllers should use this plugin and let the others  
>> do their work without being disturbed by this plugin (and you  
>> could still use it in the Root controller).
> Yes, it is a plugin. A key feature is to be able to specify a  
> "paranoid mode" in which no action will be run if there is no  
> parameter spec for it.
>
> Also you can still use it Controller-wise. If you omit the code in  
> the "begin : Private" action, the plugin will silently do it's  
> validation and place it's results
> in  $c->request->{validated}and $c->request->{validation_error} (if  
> any). You can ask for them frim within the controller and act  
> accordingly.
>
> But for me, the main point of this beast is that i can drop a  
> formal parameter definition next to a controller/action without  
> cluttering the controller code.
> (as formbuilder does and following the catalyst credo "dont repeat  
> yourself" =)
>

What, you mean like Catalyst::Controller::Formbuilder?  If so,  
emulate its example. The FB plugin is deprecated.




More information about the Catalyst mailing list