Repeated HTML output in Templates #1774
Answered
by
Grinnz
jason-wilson
asked this question in
Q&A
Replies: 1 comment 3 replies
-
… On Tue, Apr 27, 2021 at 10:14 PM jason-wilson ***@***.***> wrote:
Hi Guys,
Been playing with Mojolicious for some internal applications (and loving
it, thanks!) but struggling to find best way to solve a template rendering
issue.
Have a html pages that display quite long and complex tables (think a
spreadsheet) in one template - this is all fine.
Now have a different template and want to show only matching lines from
this original template inside another part of the page (inside a table
cell, not that should matter)
Struggling to work out how to generalise this work. In short I want a
function/helper/something that takes a perl object (it is a reference to a
hash) and render a single html table row that I can use from 2 different
templates. Main purpose is not to repeat the templating code.
I can see you could use helpers to call perl functions, but how would I
use this to generate the html output?
Sorry if not explaining well enough.
Jason
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1774>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABMARDDAVX57MPLTNGAEKMTTK5VPBANCNFSM43WD3KLQ>
.
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
jason-wilson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Guys,
Been playing with Mojolicious for some internal applications (and loving it, thanks!) but struggling to find best way to solve a template rendering issue.
Have a html pages that display quite long and complex tables (think a spreadsheet) in one template - this is all fine.
Now have a different template and want to show only matching lines from this original template inside another part of the page (inside a table cell, not that should matter)
Struggling to work out how to generalise this work. In short I want a function/helper/something that takes a perl object (it is a reference to a hash) and render a single html table row that I can use from 2 different templates. Main purpose is not to repeat the templating code.
I can see you could use helpers to call perl functions, but how would I use this to generate the html output?
Sorry if not explaining well enough.
Jason
Beta Was this translation helpful? Give feedback.
All reactions