Mojolicious::Plugin::TagHelpers - Tag Helpers Plugin
# Mojolicious $self->plugin('tag_helpers'); # Mojolicious::Lite plugin 'tag_helpers';
Mojolicous::Plugin::TagHelpers is a collection of HTML5 tag helpers for Mojolicious. Note that this module is EXPERIMENTAL and might change without warning!
<%= form_for login => (method => 'post') => {%> <%= input 'first_name' %> <%}%> <%= form_for login => {foo => 'bar'} => (method => 'post') => {%> <%= input 'first_name' %> <%}%> <%= form_for '/login' => (method => 'post') => {%> <%= input 'first_name' %> <%}%> <%= form_for 'http://mojolicious.org/login' => (method => 'post') => {%> <%= input 'first_name' %> <%}%>
Generate form for route, path or URL.
<%= img '/foo.jpg' %> <%= img '/foo.jpg', alt => 'Image' %>
Generate image tag.
<%= input 'first_name' %> <%= input 'first_name', value => 'Default name' %>
Generate form input element.
<%= label first_name => {%>First name<%}%>
Generate form label.
<%= link_to index => {%>Home<%}%> <%= link_to index => {foo => 'bar'} => (class => 'links') => {%>Home<%}%> <%= link_to '/path/to/file' => {%>File<%}%> <%= link_to 'http://mojolicious.org' => {%>Mojolicious<%}%>
Generate link to route, path or URL.
<%= script '/script.js' %> <%= script {%> var a = 'b'; <%}%>
Generate script tag.
<%= tag 'div' %> <%= tag 'div', id => 'foo' %> <%= tag div => {%>Content<%}%>
HTML5 tag generator.
Mojolicious::Plugin::TagHelpers inherits all methods from Mojolicious::Plugin and implements the following new ones.
register
$plugin->register;
Register helpers in Mojolicious application.
Mojolicious, Mojolicious::Guides, http://mojolicious.org.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.