MojoX::Dispatcher::Routes - Routes Dispatcher
use MojoX::Dispatcher::Routes; # New dispatcher my $dispatcher = MojoX::Dispatcher::Routes->new; # Dispatch $dispatcher->dispatch(MojoX::Dispatcher::Routes::Controller->new);
MojoX::Dispatcher::Routes is a MojoX::Routes based dispatcher.
MojoX::Dispatcher::Routes inherits all attributes from MojoX::Routes and implements the following 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.
MojoX::Dispatcher::Routes inherits all methods from MojoX::Routes and implements the following 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.
Mojolicious, Mojolicious::Guides, http://mojolicious.org.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.