NAME
Catalyst::Controller::MetaForm - MetaForm sugar for Catalyst
SYNOPSIS
package MyApp::Form::Login;
use Moose;
use Class::MetaForm;
has username => (
is => 'ro',
isa => 'Str',
required => 1,
);
has password => (
is => 'ro',
isa => 'Str',
required => 1,
);
package MyApp::Controller::Auth;
use base qw/Catalyst::Controller::MetaForm/;
use strict;
use warnings;
# This will require the form MyApp::Form::Login to be successfully
# validated before the code gets to execute.
sub login : Local AssertForm('Login') Args(0) {
my ($self,$c,$form) = @_;
}
# In this case, the form MyApp::Form::Something doesn't have to be
# valid in order for the action to execute.
sub somethingelse : Local Form('Something') Args(0) {
my ($self,$c,$form) = @_;
# $form will be undefined if it wasn't successfully validated
}
1;
SEE ALSO
BUGS
Most software has bugs. This module probably isn't an exception. If you find a bug please either email me, or add the bug to cpan-RT.
AUTHOR
Anders Nor Berle <berle@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2009 by Modula AS
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.