Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Control break with Template::Toolkit

by betacentauri (Sexton)
on Nov 15, 2019 at 15:02 UTC ( [id://11108745]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Control break with Template::Toolkit
in thread Control break with Template::Toolkit

Thank you all Monks for your responses! I think your discussion reflect that there is a compromise to be taken between placing too much logic (which seems a business tier concern) into the template, and on the other hand, building an extra elaborate API which caters only to some special use case. I was hoping that there would be some TT plugin to do this particular job, as it would keep the complexity hidden, my API simple, and perhaps be useful to many a user. Do you think it is an idea to push forward?

Thank you again!

  • Comment on Re^3: Control break with Template::Toolkit

Replies are listed 'Best First'.
Re^4: Control break with Template::Toolkit
by haj (Vicar) on Nov 15, 2019 at 16:57 UTC

    I would not expect such a plugin to exist, or worth writing. We have just covered one very special use case: categorizing sorted four-element arrays according to their third element, and formatting them as plain text. You may have noted that choroba's output is different from mine, but we don't know whether it matters.

    I myself would wrap the formatting into my template processing, either as a MACRO, where the transformation is done in TT language, or as a FILTER, where the transformation is done in a Perl module. Macros and filters can be predefined to the TT object, so the data template would just read [% categorize(data) %] with a macro, or [% data | categorize %] if you implement the formatting as a filter.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2024-04-25 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found