Mojolicious::Plugin::AutoRoute - Mojolicious Plugin to create routes automatically
This is beta release. Implementation will be changed without warnings.
# Mojolicious $self->plugin('AutoRoute'); # Mojolicious::Lite plugin 'AutoRoute';
Mojolicious::Plugin::AutoRoute is a Mojolicious plugin to create routes automatically.
Routes corresponding to URL is created .
TEMPLATES ROUTES templates/auto/index.html.ep # / /foo.html.ep # /foo /foo/bar.html.ep # /foo/bar /foo/bar/baz.html.ep # /foo/bar/baz
If you like PHP, this plugin is very good. You only put file into auto directory.
PHP
auto
route
route => $route;
You can set parent route if you need. This is Mojolicious::Routes object. Default is $app-routes>.
$app-
top_dir
top_dir => 'myauto'
Top directory. default is auto.
Mojolicious::Plugin::AutoRoute inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register($app);
Register plugin in Mojolicious application.
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious::Plugin::AutoRoute, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::AutoRoute
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::AutoRoute
For more information on module installation, please visit the detailed CPAN module installation guide.