| 1 | package CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate; | ||
| 2 | |||
| 3 | 5 | ▶ | use MooseX::MethodAttributes::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 5 | requires qw/ | |
| 7 | login | ||
| 8 | login_form_stash_key | ||
| 9 | /; | ||
| 10 | |||
| 11 | 7 | ▶ | after 'login' => sub { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 12 | 7 | my ( $self, $ctx ) = @_; | |
| 13 | |||
| 14 | 7 | my $rendered_form = $ctx->stash->{$self->login_form_stash_key}->render; | |
| 15 | 7 | $ctx->stash( template => \$rendered_form ); | |
| 16 | 5 | }; | |
| 17 | |||
| 18 | 5 | 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 | ||