The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MojoX::Controller - Controller Base Class

SYNOPSIS

    use base 'MojoX::Controller';

DESCRIPTION

MojoX::Controller is an abstract controllers base class.

MojoX::Controller implements the following attributes.

app

    my $app = $c->app;
    $c      = $c->app(MojoSubclass->new);

A reference back to the application that dispatched to this controller.

METHODS

MojoX::Controller inherits all methods from Mojo::Base and implements the following new ones.

render_exception

    $c->render_exception($e);

Turn exception into output.

render_not_found

    $c->render_not_found;

Default output.

stash

    my $stash = $c->stash;
    my $foo   = $c->stash('foo');
    $c        = $c->stash({foo => 'bar'});
    $c        = $c->stash(foo => 'bar');

Non persistent data storage and exchange.

    $c->stash->{foo} = 'bar';
    my $foo = $c->stash->{foo};
    delete $c->stash->{foo};

SEE ALSO

Mojolicious, Mojolicious::Guides, http://mojolicious.org.