CONTENTS
#NAME
Yancy::Plugin::Form::Bootstrap4 - Generate forms using Bootstrap 4
#VERSION
version 1.081
#SYNOPSIS
use Mojolicious::Lite;
plugin Yancy => {
backend => 'pg://localhost/mysite',
read_schema => 1,
};
app->yancy->plugin( 'Form::Bootstrap4' );
# See Yancy::Controller::Yancy for routing
app->routes->get( '/people/:id/edit' )->to(
'yancy#set',
schema => 'people',
template => 'edit_people',
);
app->start;
__DATA__
@@ edit_people.html.ep
%= $c->yancy->form->form_for( 'people' );
#DESCRIPTION
This plugin generates forms using the Bootstrap 4.0.
For details on the helpers added by this plugin, see Yancy::Plugin::Form.
#TEMPLATES
To override these templates, add your own at the designated path inside your app's templates/
directory.
#yancy/form/bootstrap4/form.html.ep
This template surrounds the form to create the <form>
element, list all the fields, and add a submit button. Also includes a CSRF token.
#yancy/form/bootstrap4/field.html.ep
This template surrounds a single form field to add a <label>
element, the appropriate input element(s), and the optional description.
#yancy/form/bootstrap4/input.html.ep
This template is for single <input>
elements and the attributes they need. This is used by field types string
, number
, integer
, and string fields with formats email
and date-time
.
#yancy/form/bootstrap4/textarea.html.ep
This template is for single <textarea>
elements and the attributes they need. This is used by fields with type string
and format textarea
.
#yancy/form/bootstrap4/select.html.ep
This template is for single <select>
elements and the attributes they need. This is used by fields with an enum
property.
#yancy/form/bootstrap4/yesno.html.ep
This template displays a yes/no toggle used for fields of type boolean
.
#yancy/form/bootstrap4/readonly.html.ep
This template displays all read-only fields. This template must not include any kind of <input>
, <select>
, or other form fields.
#SEE ALSO
#AUTHOR
Doug Bell <preaction@cpan.org>
#COPYRIGHT AND LICENSE
This software is copyright (c) 2021 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.