« Catalyst/Controller/HTML/FormFu/Action/FormConfig.pm
↑ Summary
Catalyst/Controller/HTML/FormFu/Action/MultiForm.pm »
| 1 | package Catalyst::Controller::HTML::FormFu::Action::FormMethod; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 9 | our $VERSION = '2.04'; # VERSION | |||||||||||||||||||||||||||
| 6 | 9 | our $AUTHORITY = 'cpan:NIGELM'; # AUTHORITY | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 9 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 9 | ▶ | use Carp qw( croak ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 9 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 9 | extends 'Catalyst::Controller::HTML::FormFu::ActionBase::Form'; | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 1 | ▶ | sub execute { | ||||||||||||||||||||||||||
|
Subroutine
execute: called CC=8 SCAR=22.1
Pod
documented
| |||||||||||||||||||||||||||||
| 15 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 16 | 1 | my ( $controller, $c ) = @_; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | if ( $self->reverse =~ $self->_form_action_regex ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # don't load form again | ||||||||||||||||||||||||||||
| 21 | 0 | return $self->next::method(@_); | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 1 | my $config = $controller->_html_formfu_config; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | return $self->next::method(@_) | ||||||||||||||||||||||||||||
| 27 | unless exists $self->attributes->{ActionClass} | ||||||||||||||||||||||||||||
| 28 | 1 | ▶ | && $self->attributes->{ActionClass}[0] eq $config->{method_action}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"method_action"}
MC/DC0%0/2
exists $self->attributes->{"ActionClass"} and $self->attributes->{"ActionClass"}[0] eq $config->{"method_action"}
exists $self->attributes->{"ActionClass"}
$self->attributes->{"ActionClass"}[0] eq $config->{"method_action"}
Truth table33%1/3
A and B
A= exists $self->attributes->{"ActionClass"}B= $self->attributes->{"ActionClass"}[0] eq $config->{"method_action"}
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 1 | my $form = $controller->_form; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 1 | for ( @{ $self->{_attr_params} } ) { | |||||||||||||||||||||||||||
| 33 | 1 | for my $method (split) { | |||||||||||||||||||||||||||
| 34 | 1 | ▶ | $c->log->debug($method) if $c->debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 1 | ▶ | my $args = $controller->$method($c) || {}; | ||||||||||||||||||||||||||
|
Condition50%1/2
$controller->$method($c) || {}
MC/DC0%0/1
$controller->$method($c) || {}
$controller->$method($c)
Truth table50%1/2
A
A= $controller->$method($c)
| |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | 1 | $form->populate($args); | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 1 | $form->process; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 1 | $c->stash->{ $config->{form_stash} } = $form; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 1 | $self->next::method(@_); | |||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 9 | 1; | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | __END__ | ||||||||||||||||||||||||||||