On Tue, May 16, 2017 at 10:15 AM, <[email protected]> wrote:

> Even if stash->{mess_textes} does not exists, hi prints the <br>...


I don't find this to be the case.

*$ cat stash *
#!/usr/bin/env perl
use Mojolicious::Lite;

get '/missing' => sub { shift->render } => 'index';
get '/empty' => sub { shift->render(mess_textes => [qw//]) } => 'index';
get '/exists' => sub { shift->render(mess_textes => [qw/1 2 3/]) } =>
'index';

app->start;
__DATA__

@@ index.html.ep
% if (exists stash->{mess_textes}) {
%  foreach my $item (@{stash->{mess_textes}}) {
   <%= $item %><br>
  % }
  <br>
% }
*$ env MOJO_LOG_LEVEL=info perl stash get /missing*
*$ env MOJO_LOG_LEVEL=info perl stash get /empty*
  <br>
*$ env MOJO_LOG_LEVEL=info perl stash get /exists*
   1<br>
   2<br>
   3<br>
  <br>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to