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

NAME

Mojolicious - Web Framework

SYNOPSIS

    use base 'Mojolicious';

    sub startup {
        my $self = shift;

        my $r = $self->routes;

        $r->route('/:controller/:action')
          ->to(controller => 'foo', action => 'bar');
    }

DESCRIPTION

Mojolicous is a MVC web framework built upon Mojo.

For userfriendly documentation see Mojolicious::Book and Mojolicious::Lite.

ATTRIBUTES

Mojolicious inherits all attributes from Mojo and implements the following new ones.

mode

    my $mode = $mojo->mode;
    $mojo    = $mojo->mode('production');

plugins

    my $plugins = $mojo->plugins;
    $mojo       = $mojo->plugins(Mojolicious::Plugins->new);

renderer

    my $renderer = $mojo->renderer;
    $mojo        = $mojo->renderer(Mojolicious::Renderer->new);

routes

    my $routes = $mojo->routes;
    $mojo      = $mojo->routes(Mojolicious::Dispatcher->new);

static

    my $static = $mojo->static;
    $mojo      = $mojo->static(MojoX::Dispatcher::Static->new);

types

    my $types = $mojo->types;
    $mojo     = $mojo->types(MojoX::Types->new)

METHODS

Mojolicious inherits all methods from Mojo and implements the following new ones.

new

    my $mojo = Mojolicious->new;

dispatch

    $mojo->dispatch($c);

handler

    $tx = $mojo->handler($tx);

plugin

    $mojo->plugin('something');
    $mojo->plugin('something', foo => 23);
    $mojo->plugin('something', {foo => 23});

process

    $mojo->process($c);

start

    Mojolicious->start;
    Mojolicious->start('daemon');

startup

    $mojo->startup($tx);