1Mojolicious::Plugin::TaUgsHeerlpCeornst(r3i)buted Perl DMoocjuomleinctiaotuiso:n:Plugin::TagHelpers(3)
2
3
4

NAME

6       Mojolicious::Plugin::TagHelpers - Tag Helpers Plugin
7

SYNOPSIS

9           # Mojolicious
10           $self->plugin('tag_helpers');
11
12           # Mojolicious::Lite
13           plugin 'tag_helpers';
14

DESCRIPTION

16       Mojolicous::Plugin::TagHelpers is a collection of HTML5 tag helpers for
17       Mojolicious.  Note that this module is EXPERIMENTAL and might change
18       without warning!
19
20   Helpers
21       form_for
22               <%= form_for login => (method => 'post') => {%>
23                   <%= input 'first_name' %>
24               <%}%>
25               <%= form_for login => {foo => 'bar'} => (method => 'post') => {%>
26                   <%= input 'first_name' %>
27               <%}%>
28               <%= form_for '/login' => (method => 'post') => {%>
29                   <%= input 'first_name' %>
30               <%}%>
31               <%= form_for 'http://mojolicious.org/login' => (method => 'post') => {%>
32                   <%= input 'first_name' %>
33               <%}%>
34
35           Generate form for route, path or URL.
36
37       img
38               <%= img '/foo.jpg' %>
39               <%= img '/foo.jpg', alt => 'Image' %>
40
41           Generate image tag.
42
43       input
44               <%= input 'first_name' %>
45               <%= input 'first_name', value => 'Default name' %>
46
47           Generate form input element.
48
49       label
50               <%= label first_name => {%>First name<%}%>
51
52           Generate form label.
53
54       link_to
55               <%= link_to index => {%>Home<%}%>
56               <%= link_to index => {foo => 'bar'} => (class => 'links') => {%>Home<%}%>
57               <%= link_to '/path/to/file' => {%>File<%}%>
58               <%= link_to 'http://mojolicious.org' => {%>Mojolicious<%}%>
59
60           Generate link to route, path or URL.
61
62       script
63               <%= script '/script.js' %>
64               <%= script {%>
65                   var a = 'b';
66               <%}%>
67
68           Generate script tag.
69
70       tag
71               <%= tag 'div' %>
72               <%= tag 'div', id => 'foo' %>
73               <%= tag div => {%>Content<%}%>
74
75           HTML5 tag generator.
76

METHODS

78       Mojolicious::Plugin::TagHelpers inherits all methods from
79       Mojolicious::Plugin and implements the following new ones.
80
81   "register"
82           $plugin->register;
83
84       Register helpers in Mojolicious application.
85

SEE ALSO

87       Mojolicious, Mojolicious::Guides, <http://mojolicious.org>.
88
89
90
91perl v5.12.3                      2011-05-03Mojolicious::Plugin::TagHelpers(3)
Impressum