In my experience is the MVC approach more an ideal° than a bulletproof method.

BUT ... in this case I'd say it belongs into the View.

One rational for MVCs is the possibility to delegate responsibility to domain experts in your team (or to be at least capable to easily scale your team up if necessary)

So ask yourself: Whose responsibility is it?

IMHO it'll be the decision of the designer of the View how long the visible text is and how it's presented.

It's not the domain of the programmer (Controller) nor the DB-Admin (Model)

Unfortunately I lack expertise with Template::Toolkit on how best to achieve this ... it has it's own mini language.

But I suppose there is more then one way and the Monastery is full of experts. :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) Shaky Metaphor: A good Christian might attempt to follow the example of Jesus, but not many are ready to die at the cross.

UPDATE

> The other way I came up with was to use a callback from the template to the Perl function that splits the text. Again, this seems to tie the logic and display together.

I'd keep such Perl code inside a separate file/module named like view_helper.pl with an extra namespace like package View::Helper;

See it as an extension of your template framework in the responsibility of your designer. He might delegate change requests to the programmer, if he can't handle Perl, but it's his call.


In reply to Re: Splitting long text for Template (updated) by LanX
in thread Splitting long text for Template by Bod

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.