Why do you want to use TT Filter?

The way I would approach this problem would be to add some methods to your Bio::Seq class that return html to pretty print your sequence. That way your template just becomes:

The sequence is:[% bio_seq.seq_pretty_display %]

This will have the effect of moving the pretty printing code into your class where it is easier to test, but breaks the strict MVC paradigm of keeping the View separate from the model and controller.

My answer to any pedant who raises that point, is that perl has always been about being pragmatic and getting things done, rather than blind adherence to a particular design pattern.


In reply to Re: Catalyst::VIew::TT - format an object by chrestomanci
in thread Catalyst::VIew::TT - format an object by tospo

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.