Dear monks,

thanks for your insightful comments.

I will "go with the crowd" as sundialsvc4 in Re: The hidden charm of Template::Toolkit (and templates generally) suggested, with the (probably less populous) mason crowd.

Although I think modules are equivalent to mason components, the mason componenents use different (lowercased) names and path tree which distinguish them better from Controller and Model components, than some MyApp::View::Books, ... view perl modules. Also Mason is already used in my company.

I don't want to bother you with repeating myself, the following lines are meant mostly for my relief.

Personally I consider templates being "false mistresses". They are seducing you with: "Don't code, let's go templating", but soon after start you will meet variables, loops, conditions, methods, ...

The example below is taken from Catalyst tutorial, it is pretty simple and yet it contains a bit of programming, while the authors are not even linked.

[% FOREACH book IN books -%] <tr> <td>[% book.title %]</td> <td>[% book.rating %]</td> <td> [% tt_authors = [ ]; tt_authors.push(author.last_name) FOREACH author = book.a +uthors %] [% # Now use a TT 'virtual method' to display the author cou +nt in parens -%] ([% tt_authors.size %]) [% # Use another TT vmethod to join & print the names & comm +a separators -%] [% tt_authors.join(', ') %] </td> </tr> [% END -%]

In Mason, you start with plain HTML interspersed with occasional perl lines and end up with components, subcomponents, filtering, attributes, methods, ...

However If the only risk of inappropriate tool for view implementation are difficulties caused by my cubicle being tsunamized (Re: The hidden charm of Template::Toolkit (and templates generally)) I stay calm. In Czech republic, I can take the risk. :-)


In reply to Re: The hidden charm of Template::Toolkit (and templates generally) by roman
in thread The hidden charm of Template::Toolkit (and templates generally) by roman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.