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

Markus Holzer holli.holzer at googlemail.com
Wed Apr 9 11:07:41 BST 2008

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" =)

I'm still thinking about how to add a kind of polymorphism to this.

More information about the Catalyst mailing list