Greetings to developers of the most mojolicious:) web-framework and to 
developers using in their projects!
I'd very appreciate if someone helps me to understand, if I can define and 
use subroutines in templates.

For example, there's a template that doesn't work:

% layout 'default';
<div class="container">
  <h1>Make yourself at home, <%= $self->session('user_email') %>!</h1>
% expand_tree($service_tree);
</div>
%
%
%
% sub expand_tree {
  <pre>DEBUG</pre>
%   my $node = shift;
%   foreach my $node_type (keys(%{ $node })) {
  <div class="<%= $node_type %>">
    <h2><%= $node_type.'s' %></h2>
    <ul>
%     foreach my $child (keys(%{ $node->{$node_type} })) {
      <li><%= $child %></li>
%     }
    </ul>
  </div>
%   }
% }

I'm calling the subroutine, the layout is applied, "f* yourself at home", 
but expand_tree doesn't send anything out. It even didn't print 
<pre>DEBUG</pre>, which it supposed to do. If I say die() inside that sub, 
it dies, but why does it keep silence when it's alive?

Thank y'all very much for any suggestions.

-- 
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 http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to