Split more path_tos out into app config, add encoding
Tomas Doran [Wed, 15 Feb 2012 20:37:31 +0000 (20:37 +0000)]
lib/Catalyst/View/TT.pm

index 5056726..3e51303 100644 (file)
@@ -33,13 +33,10 @@ Catalyst::View::TT - Template View Class
 
     __PACKAGE__->config(
         # any TT configuration items go here
-        INCLUDE_PATH => [
-          MyApp->path_to( 'root', 'src' ),
-          MyApp->path_to( 'root', 'lib' ),
-        ],
         TEMPLATE_EXTENSION => '.tt',
         CATALYST_VAR => 'c',
         TIMER        => 0,
+        ENCODING     => 'utf-8'
         # Not set by default
         PRE_PROCESS        => 'config/main',
         WRAPPER            => 'site/wrapper',
@@ -47,6 +44,17 @@ Catalyst::View::TT - Template View Class
         expose_methods => [qw/method_in_view_class/],
     );
 
+# add include path configuration in MyApp.pm
+
+    __PACKAGE__->config(
+        'View::Web' => {
+            INCLUDE_PATH => [
+                __PACKAGE__->path_to( 'root', 'src' ),
+                __PACKAGE__->path_to( 'root', 'lib' ),
+            ],
+        },
+    );
+
 # render view from lib/MyApp.pm or lib/MyApp::Controller::SomeController.pm
 
     sub message : Global {