[Catalyst-commits] r10094 - in trunk/Catalyst-View-TT: . lib/Catalyst/Helper/View lib/Catalyst/View

bricas at dev.catalyst.perl.org bricas at dev.catalyst.perl.org
Tue May 12 13:04:49 GMT 2009


Author: bricas
Date: 2009-05-12 13:04:49 +0000 (Tue, 12 May 2009)
New Revision: 10094

Modified:
   trunk/Catalyst-View-TT/Changes
   trunk/Catalyst-View-TT/lib/Catalyst/Helper/View/TT.pm
   trunk/Catalyst-View-TT/lib/Catalyst/View/TT.pm
Log:
- Doc fixes:
  + Expand ::V:: to ::View:: (RT #45792)
  + Expand ::C:: to ::Controller:: and use $c->view('TT')
    where appropriate (bricas)
- "use warnings" in Catalyst::View::TT and output from the TT helper

Modified: trunk/Catalyst-View-TT/Changes
===================================================================
--- trunk/Catalyst-View-TT/Changes	2009-05-12 12:40:51 UTC (rev 10093)
+++ trunk/Catalyst-View-TT/Changes	2009-05-12 13:04:49 UTC (rev 10094)
@@ -1,5 +1,12 @@
 Revision history for Perl extension Catalyst::View::TT.
 
+0.30    XXXX-XX-XX
+        - Doc fixes:
+          + Expand ::V:: to ::View:: (RT #45792)
+          + Expand ::C:: to ::Controller:: and use $c->view('TT')
+            where appropriate (bricas)
+        - "use warnings" in Catalyst::View::TT and output from the TT helper
+
 0.29    2009-02-20 14:43:00
         - Remove extra unwanted .gitignore from manifest
 

Modified: trunk/Catalyst-View-TT/lib/Catalyst/Helper/View/TT.pm
===================================================================
--- trunk/Catalyst-View-TT/lib/Catalyst/Helper/View/TT.pm	2009-05-12 12:40:51 UTC (rev 10093)
+++ trunk/Catalyst-View-TT/lib/Catalyst/Helper/View/TT.pm	2009-05-12 13:04:49 UTC (rev 10094)
@@ -51,6 +51,8 @@
 package [% class %];
 
 use strict;
+use warnings;
+
 use base 'Catalyst::View::TT';
 
 __PACKAGE__->config(TEMPLATE_EXTENSION => '.tt');

Modified: trunk/Catalyst-View-TT/lib/Catalyst/View/TT.pm
===================================================================
--- trunk/Catalyst-View-TT/lib/Catalyst/View/TT.pm	2009-05-12 12:40:51 UTC (rev 10093)
+++ trunk/Catalyst-View-TT/lib/Catalyst/View/TT.pm	2009-05-12 13:04:49 UTC (rev 10094)
@@ -1,13 +1,15 @@
 package Catalyst::View::TT;
 
 use strict;
+use warnings;
+
 use base qw/Catalyst::View/;
 use Data::Dump 'dump';
 use Template;
 use Template::Timer;
 use MRO::Compat;
 
-our $VERSION = '0.29';
+our $VERSION = '0.30';
 
 __PACKAGE__->mk_accessors('template');
 __PACKAGE__->mk_accessors('include_path');
@@ -43,13 +45,13 @@
         },
     );
          
-# render view from lib/MyApp.pm or lib/MyApp::C::SomeController.pm
+# render view from lib/MyApp.pm or lib/MyApp::Controller::SomeController.pm
     
     sub message : Global {
         my ( $self, $c ) = @_;
         $c->stash->{template} = 'message.tt2';
         $c->stash->{message}  = 'Hello World!';
-        $c->forward('MyApp::V::TT');
+        $c->forward('MyApp::View::TT');
     }
 
 # access variables from template
@@ -274,11 +276,11 @@
 
     $ script/myapp_create.pl view TT TT
 
-This creates a MyApp::V::TT.pm module in the F<lib> directory (again,
+This creates a MyApp::View::TT.pm module in the F<lib> directory (again,
 replacing C<MyApp> with the name of your application) which looks
 something like this:
 
-    package FooBar::V::TT;
+    package FooBar::View::TT;
     
     use strict;
      use base 'Catalyst::View::TT';
@@ -294,7 +296,7 @@
     
     sub end : Private {
         my( $self, $c ) = @_;
-        $c->forward('MyApp::V::TT');
+        $c->forward('MyApp::View::TT');
     }
 
 =head2 CONFIGURATION
@@ -303,12 +305,12 @@
 first way is to call the C<config()> method in the view subclass.  This
 happens when the module is first loaded.
 
-    package MyApp::V::TT;
+    package MyApp::View::TT;
     
     use strict;
     use base 'Catalyst::View::TT';
 
-    MyApp::V::TT->config({
+    MyApp::View::TT->config({
         INCLUDE_PATH => [
             MyApp->path_to( 'root', 'templates', 'lib' ),
             MyApp->path_to( 'root', 'templates', 'src' ),
@@ -352,7 +354,7 @@
     MyApp->config({
         name     => 'MyApp',
         root     => MyApp->path_to('root'),
-        'V::TT' => {
+        'View::TT' => {
             INCLUDE_PATH => [
                 MyApp->path_to( 'root', 'templates', 'lib' ),
                 MyApp->path_to( 'root', 'templates', 'src' ),
@@ -403,7 +405,7 @@
     sub message : Global {
         my ( $self, $c ) = @_;
         $c->stash->{template} = 'message.tt2';
-        $c->forward('MyApp::V::TT');
+        $c->forward( $c->view('TT') );
     }
 
 If a stash item isn't defined, then it instead uses the
@@ -418,7 +420,7 @@
         my ( $self, $c ) = @_;
         $c->stash->{template} = 'message.tt2';
         $c->stash->{message}  = 'Hello World!';
-        $c->forward('MyApp::V::TT');
+        $c->forward( $c->view('TT') );
     }
 
 A number of other template variables are also added:
@@ -519,7 +521,7 @@
     MyApp->config({
         name     => 'MyApp',
         root     => MyApp->path_to('root'),
-        'V::TT' => {
+        'View::TT' => {
             CATALYST_VAR => 'Catalyst',
         },
     });
@@ -553,7 +555,7 @@
 
 For example:
 
-  package MyApp::C::Test;
+  package MyApp::Controller::Test;
   sub test : Local { .. } 
 
 Would by default look for a template in <root>/test/test. If you set TEMPLATE_EXTENSION to '.tt', it will look for
@@ -566,7 +568,7 @@
     MyApp->config({
         name     => 'MyApp',
         root     => MyApp->path_to('root'),
-        'V::TT' => {
+        'View::TT' => {
             PROVIDERS => [
                 {
                     name    => 'DBI',




More information about the Catalyst-commits mailing list