File Coverage

blib/lib/Yancy/Plugin/Form/Bootstrap4.pm
Criterion Covered Total %
statement 76 81 93.8
branch 39 44 88.6
condition 32 41 78.0
subroutine 7 7 100.0
pod 1 6 16.6
total 155 179 86.5


line stmt bran cond sub pod time code
1             package Yancy::Plugin::Form::Bootstrap4;
2             our $VERSION = '1.087';
3             # ABSTRACT: Generate forms using Bootstrap 4
4              
5             #pod =head1 SYNOPSIS
6             #pod
7             #pod use Mojolicious::Lite;
8             #pod plugin Yancy => {
9             #pod backend => 'pg://localhost/mysite',
10             #pod read_schema => 1,
11             #pod };
12             #pod app->yancy->plugin( 'Form::Bootstrap4' );
13             #pod # See Yancy::Controller::Yancy for routing
14             #pod app->routes->get( '/people/:id/edit' )->to(
15             #pod 'yancy#set',
16             #pod schema => 'people',
17             #pod template => 'edit_people',
18             #pod );
19             #pod app->start;
20             #pod __DATA__
21             #pod @@ edit_people.html.ep
22             #pod %= $c->yancy->form->form_for( 'people' );
23             #pod
24             #pod =head1 DESCRIPTION
25             #pod
26             #pod This plugin generates forms using the L
27             #pod 4.0|https://getbootstrap.com/docs/4.0/>.
28             #pod
29             #pod For details on the helpers added by this plugin, see
30             #pod L.
31             #pod
32             #pod =head1 TEMPLATES
33             #pod
34             #pod To override these templates, add your own at the designated path inside
35             #pod your app's C directory.
36             #pod
37             #pod =head2 yancy/form/bootstrap4/form.html.ep
38             #pod
39             #pod This template surrounds the form to create the C<<
>> element,
40             #pod list all the fields, and add a submit button. Also includes a CSRF token.
41             #pod
42             #pod =head2 yancy/form/bootstrap4/field.html.ep
43             #pod
44             #pod This template surrounds a single form field to add a C<<
45             #pod element, the appropriate input element(s), and the optional description.
46             #pod
47             #pod =head2 yancy/form/bootstrap4/input.html.ep
48             #pod
49             #pod This template is for single C<< >> elements and the attributes
50             #pod they need. This is used by field types C, C, C,
51             #pod and string fields with formats C and C.
52             #pod
53             #pod =head2 yancy/form/bootstrap4/textarea.html.ep
54             #pod
55             #pod This template is for single C<<