Skip to content

Commit

Permalink
show an array reference too
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 7, 2016
1 parent 625ee42 commit 486b22a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Mojo/Template.pm
Expand Up @@ -326,18 +326,18 @@ Mojo::Template - Perl-ish templates
EOF
# Render with arguments
say $mt->render(<<'EOF', 23, 'Arguments');
% my ($num, $title) = @_;
say $mt->render(<<'EOF', [1 .. 13], 'Hello World!');
% my ($numbers, $title) = @_;
<div>
<h1><%= $title %></h1>
% for my $i (1 .. $num) {
% for my $i (@$numbers) {
* some text <%= $i %>
% }
</div>
EOF
# Render with named variables
say $mt->vars(1)->render(<<'EOF', {title => 'Variables'});
say $mt->vars(1)->render(<<'EOF', {title => 'Hello World!'});
<div>
<h1><%= $title %></h1>
%= 5 + 5
Expand Down

0 comments on commit 486b22a

Please sign in to comment.