thanks, luc.  it's good to know that I am doing it right.

PS: I decided in my code that the controller is only about the glue between 
the model and the display, and the template is about the display.  so, I 
occasionally have the need to manipulate a hash (or something more complex) 
into a display.


On Saturday, May 27, 2017 at 3:22:41 AM UTC-7, Luc Didry wrote:
>
> vendredi 26 mai 2017, 08:56:22 CEST iaw4 wrote: 
> > 
> > dear M users: right now, I am using 
> > 
> > <% my $rv; ...lots of perl code to build up $rv %> <%== $rv %> 
> > 
> > is this the recommended way?  or is there a combining method? 
> > 
> > regards, 
> > 
> > /iaw 
> > 
> > 
>
> For readability, I would suggest using 
> % my $rv; 
> % lots of perl code to build up $rv 
>
> <%== $rv %> 
>
> But that's just an aesthetic change, you way is good. But do you really 
> need to 
> build $rv in your template? Always better to put big chunks of code in a 
> controller. 
>
> Be aware that <%== $rv %> doesn't escape html tags! I may be what you 
> want, 
> but if you want to escape the html tags, you should use <%= $rv %> 
> -- 
> Luc 
> https://fiat-tux.fr/ 
> https://luc.frama.io/ 
> Internet n'est pas compliqué, Internet est ce que vous en faites. 
>
>

-- 
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