The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

MojoX::Controller - Controller Base Class

SYNOPSIS

use base 'MojoX::Controller';

DESCRIPTION

MojoX::Controller is an abstract controllers base class.

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.