NAME

MojoX::Dispatcher::Routes - Routes Dispatcher

SYNOPSIS

use MojoX::Dispatcher::Routes;

# New dispatcher
my $dispatcher = MojoX::Dispatcher::Routes->new;

# Dispatch
$dispatcher->dispatch(MojoX::Dispatcher::Routes::Controller->new);

DESCRIPTION

MojoX::Dispatcher::Routes is a MojoX::Routes based dispatcher.

ATTRIBUTES

MojoX::Dispatcher::Routes inherits all attributes from MojoX::Routes and implements the follwing the ones.

controller_base_class

my $base    = $dispatcher->controller_base_class;
$dispatcher = $dispatcher->controller_base_class(
    'MojoX::Dispatcher::Routes::Controller'
);

Base class used to identify controllers, defaults to MojoX::Dispatcher::Routes::Controller.

hidden

my $hidden  = $dispatcher->hidden;
$dispatcher = $dispatcher->hidden(
    [qw/new attr tx render req res stash/]
);

Methods and attributes that are hidden from the dispatcher.

namespace

my $namespace = $dispatcher->namespace;
$dispatcher   = $dispatcher->namespace('Foo::Bar::Controller');

Namespace to search for controllers.

METHODS

MojoX::Dispatcher::Routes inherits all methods from MojoX::Routes and implements the follwing the ones.

auto_render

$dispatcher->auto_render(MojoX::Dispatcher::Routes::Controller->new);

Automatic rendering.

dispatch

my $e = $dispatcher->dispatch(
    MojoX::Dispatcher::Routes::Controller->new
);

Match routes and dispatch.

hide

$dispatcher = $dispatcher->hide('new');

Hide method or attribute from the dispatcher.

SEE ALSO

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