File Coverage

blib/lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/RenderAsTTTemplate.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate;
2              
3 5     5   7191 use MooseX::MethodAttributes::Role;
  5         9  
  5         43  
4 5     5   33837 use namespace::autoclean;
  5         11  
  5         30  
5              
6             requires qw/
7             login
8             login_form_stash_key
9             /;
10              
11             after 'login' => sub {
12             my ( $self, $ctx ) = @_;
13              
14             my $rendered_form = $ctx->stash->{$self->login_form_stash_key}->render;
15             $ctx->stash( template => \$rendered_form );
16             };
17              
18             1;
19              
20             =head1 NAME
21              
22             CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate - render a login form with no template file
23              
24             =head1 DESCRIPTION
25              
26             Simple controller role to allow rendering a login form with no
27             template file. Sets the stash 'template' key to a string reference
28             containing the rendered form.
29              
30             =head1 METHODS
31              
32             =head2 after 'login'
33              
34             $ctx->stash( template => \$self->render_login_form($ctx, $result) );
35              
36             =head1 SEE ALSO
37              
38             =over
39              
40             =item L<CatalystX::SimpleLogin::Controller::Login>
41              
42             =back
43              
44             =head1 AUTHORS
45              
46             See L<CatalystX::SimpleLogin> for authors.
47              
48             =head1 LICENSE
49              
50             See L<CatalystX::SimpleLogin> for license.
51              
52             =cut