Mojolicious::Plugin::DBIC::Controller::DBIC - Build simple views to DBIC data
version 0.001
use Mojolicious::Lite; plugin DBIC => { schema => ... }; get '/', { controller => 'DBIC', action => 'list', resultset => 'BlogPosts', template => 'blog/list', };
This controller allows for easy working with data from the schema. Controllers are configured through the stash when setting up the routes.
get '/', { controller => 'DBIC', action => 'list', resultset => 'BlogPosts', template => 'blog/list', };
List data in a ResultSet.
This method uses the following stash values for configuration:
The DBIx::Class::ResultSet class to list.
This method sets the following stash values for template rendering:
The DBIx::Class::ResultSet object containing the desired objects.
get '/blog/:id', { controller => 'DBIC', action => 'get', resultset => 'BlogPosts', template => 'blog/get', };
Fetch a single result by its ID.
The DBIx::Class::ResultSet class to use.
The ID to pass to "find" in DBIx::Class::ResultSet.
The DBIx::Class::Row object containing the desired object.
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2018 by Doug Bell.
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 Mojolicious::Plugin::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::DBIC
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.