[Catalyst] Using $c->view('TT')->render for emails
Mark Zealey
mark at itsolve.co.uk
Tue Feb 6 23:09:26 GMT 2007
I'd just create a separate TT view instance eg i call my website
view 'C::V::Website' and my email view 'C::V::Email' and then just parse it
through that - means you can have different dirs /root/website
and /root/email with different variables - the email and website views are
generally very different so best have them as different objects, even if the
same base class.
Mark
On Tuesday 06 February 2007 10:53 pm, Jim Spath wrote:
> In the docs for Catalyst::View::TT and Catalyst::Plugin::Email, it
> suggests using $c->view('TT')->render() for the rendering of email
> templates.
>
> My issue is that I created my Catalyst view with TTSite as described in
> the CatalystBasics tutorial, and when I call the render method on the
> email template, all of the site templates (header, footer, etc) are
> pulled in, when all I really want is the email template by itself.
>
> What is the right solution? Should I create a new view just for email
> templates? Should I modify my existing view in some way to allow it to
> output both normal site templates and one-off templates? Should I not
> use render() for email templates?
>
> Thanks!
> - Jim
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
More information about the Catalyst
mailing list