CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate - CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate documentation


CatalystX-SimpleLogin documentation Contained in the CatalystX-SimpleLogin distribution.

Index


Code Index:

NAME

Top

CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate

DESCRIPTION

Top

Simple controller role to allow rendering a login form with no template file. Sets the stash 'template' key to a string reference containing the rendered form.

METHODS

Top

after 'login'

  $ctx->stash( template => \$self->render_login_form($ctx, $result) );

SEE ALSO

Top

CatalystX::SimpleLogin::ControllerRole::Login

AUTHORS

Top

See CatalystX::SimpleLogin for authors.

LICENSE

Top

See CatalystX::SimpleLogin for license.


CatalystX-SimpleLogin documentation Contained in the CatalystX-SimpleLogin distribution.

package CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate;

use MooseX::MethodAttributes::Role;
use namespace::autoclean;

requires qw/
    login
    login_form_stash_key
/;

after 'login' => sub {
    my ( $self, $ctx ) = @_;

    my $rendered_form = $ctx->stash->{$self->login_form_stash_key}->render;
    $ctx->stash( template => \$rendered_form );
};

1;