App::skryf::Plugin::Admin - Mojolicious Plugin
# Administration section my $admin = App::skryf::Plugin::Admin->new(app => $app); my $auth_r = $app->routes->under($admin->is_admin); if ($auth_r) { $auth_r->route($admin->path_prefix . '/blog')->via('GET')->to( cb => sub { my $self = shift; $self->stash(postlist => $self->model->all); $self->render('/blog/dashboard'); } )->name('admin_blog_dashboard'); }
App::skryf::Plugin::Admin is a Mojolicious plugin.
Administration top level path prefix, e.g. /admin
Should be passed an Mojolicious application object.
App::skryf::Plugin::Admin inherits all methods from Mojolicious::Plugin and implements the following new ones.
$admin->is_admin;
Checks if current session for authenticated user is available.
Extends the authenticated route under admin_prefix, e.g. /admin/blog/dashboard
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
This plugin is copyright (c) 2013 by Adam Stokes <adamjs@cpan.org>
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::skryf::Plugin::Admin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::skryf::Plugin::Admin
CPAN shell
perl -MCPAN -e shell install App::skryf::Plugin::Admin
For more information on module installation, please visit the detailed CPAN module installation guide.