On Wed, 29 Jul 2020 10:17:05 -0700 (PDT)
Sebastian Riedel <[email protected]> wrote:

> >
> > The problem is that some of the display logic is fairly
> > complicated: one of my templates has a 30 line <% %> block before
> > anything can be displayed. It strikes me that these 30 lines (and
> > others) are better off in a subroutine or method. But where?
> > MyApp::View? How would I call it from a template? None of the
> > documentation I can find addresses this. I appreciate any pointers
> > or examples. 
> 
>  You want application specific plugins with helpers.
> 
> https://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Adding-a-plugin-to-your-application
> https://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Adding-helpers

Thanks.  The cookbook is especially helpful.  I just didn't grasp its
significance the previous times I read it.  I'll be creating
MyApp::Plugins::ViewHelpers.

Jim

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/20200729133413.67f531c0%40doliolum.thaliacea.lan.

Reply via email to