[Catalyst] RFC: Reusable actions
Sebastian Riedel
sri at oook.de
Thu Apr 6 17:37:51 CEST 2006
06.04.2006 17:28 Bill Moseley:
>> sub add : Local : Action('Add') {
>> my ( $self, $c ) = @_;
>> $c->stash->{validate} = HTML::Widget->new;
>> $c->stash->{validate}->constraint( 'ASCII', 'foo' );
>> }
>
> So you are setting up a form there? Still seems specific to a given
> controller, but I suppose you could use that to build forms that
> share common elements.
No, this H::W object just validates, don't forget multiple of them
can be merged.
And this validation object is the *only* controller specific code
here, everything else happens in the generic Add class.
--
sebastian
More information about the Catalyst
mailing list