Navigation Menu

Skip to content

Commit

Permalink
more diverse tag helper examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 9, 2014
1 parent e865af5 commit d04d2de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.67 2014-01-08
4.67 2014-01-09
- Added history and max_history_size attributes to Mojo::Log.
- Improved exception and not found pages with log messages.
- Improved exception page with more information.
Expand Down
16 changes: 8 additions & 8 deletions lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -297,13 +297,13 @@ L<Mojolicious::Plugin::TagHelpers> implements the following helpers.
=head2 check_box
%= check_box employed => 1
%= check_box employed => 1, id => 'foo'
%= check_box employed => 1, disabled => 'disabled'
Generate checkbox input element. Previous input values will automatically get
picked up and shown as default.
<input name="employed" type="checkbox" value="1" />
<input id="foo" name="employed" type="checkbox" value="1" />
<input disabled="disabled" name="employed" type="checkbox" value="1" />
=head2 color_field
Expand Down Expand Up @@ -386,8 +386,8 @@ Generate file input element.
%= text_field 'first_name'
%= submit_button
% end
%= form_for '/login' => (method => 'POST') => begin
%= text_field 'first_name'
%= form_for '/login' => (enctype => 'multipart/form-data') => begin
%= text_field 'first_name', disabled => 'disabled'
%= submit_button
% end
%= form_for 'http://example.com/login' => (method => 'POST') => begin
Expand All @@ -407,8 +407,8 @@ automatically added.
<input name="first_name" />
<input value="Ok" type="submit" />
</form>
<form action="/path/to/login" method="POST">
<input name="first_name" />
<form action="/path/to/login" enctype="multipart/form-data">
<input disabled="disabled" name="first_name" />
<input value="Ok" type="submit" />
</form>
<form action="http://example.com/login" method="POST">
Expand Down Expand Up @@ -589,7 +589,7 @@ picked up and shown as default.
%= select_field country => [qw(de en)]
%= select_field country => [[Germany => 'de'], 'en'], id => 'eu'
%= select_field country => [[Germany => 'de', class => 'eu'], 'en']
%= select_field country => [[Germany => 'de', disabled => 'disabled'], 'en']
%= select_field country => [c(EU => [[Germany => 'de'], 'en'], id => 'eu')]
%= select_field country => [c(EU => [qw(de en)]), c(Asia => [qw(cn jp)])]
Expand All @@ -606,7 +606,7 @@ automatically get picked up and shown as default.
<option value="en">en</option>
</select>
<select name="country">
<option class="eu" value="de">Germany</option>
<option disabled="disabled" value="de">Germany</option>
<option value="en">en</option>
</select>
<select name="country">
Expand Down

0 comments on commit d04d2de

Please sign in to comment.