[Catalyst] Catalyst future again

Drew Taylor taylor.andrew.j at gmail.com
Fri Sep 2 06:42:41 CEST 2005


On 9/1/05, Sebastian Riedel <sri at oook.de> wrote:
> 
> 
> * Andy Wardley spent some time improving the TT view and on a new helper 
> named Catalyst::Helper::View::TTSite.
> The helper is much more verbose than the default one and creates 
> "everything" you need for a TT powered Catalyst app (templates, macros, 
> directories...), i'm sure all advanced TT users will love it.
> 

I tried this out tonight and wasted several hours trying unsuccessfully to 
get it to work. Here's what I found:

1) The TTSite helper creates the template in $appdir/templates, while the 
generated view (MyApp::V::TT) was setting INCLUDE_PATH to 
["$appdir/root/templates/lib", "$appdir/root/templates/src"]. Needless to 
say this caused problems. :-)

2) I never could get the wrapper to work. I tried all three methods 
mentioned in the docs to set the various options for Template. I even tried 
using the Singleton plugin to get the context at the class level and do the 
configuration there.

package MyApp::V::TT;
use base 'Catalyst::View::TT';
use MyApp;

my $root = MyApp->instance->{root}; # caused error because instance() 
returned undef;
__PACKAGE__->config({INCLUDE_PATH=>["$root/templates/lib", 
"$root/templates/src"]});

It appears that the INCLUDE_PATH was never making it to
Template.pm<http://Template.pm>because if I put
welcome.tt2 into $root that single template was rendered (no wrapper, 
styles, etc). I'd love to be able to use the new TTSite helper, but I'm not 
familiar enough with internals to debug where the config is going wrong.

Drew
-- 
----------------------------------------------------------------
Drew Taylor * Web development & consulting
Email: drew at drewtaylor.com * Site implementation & hosting
Web : www.drewtaylor.com <http://www.drewtaylor.com> * 
perl/mod_perl/DBI/mysql/postgres
----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050902/89b69cb0/attachment.htm


More information about the Catalyst mailing list