Subject: | Misleading use of V::TT in documentation |
In the configuration examples, View::TT is shortened to V::TT, which I
personally found confusing. The attached patch (against svn trunk)
changes all the instances of V::TT to View::TT.
The tests still all pass on my machine after this change.
Subject: | view.tt.diff |
Index: TT.pm
===================================================================
--- TT.pm (revision 10026)
+++ TT.pm (working copy)
@@ -49,7 +49,7 @@
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 +274,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 +294,7 @@
sub end : Private {
my( $self, $c ) = @_;
- $c->forward('MyApp::V::TT');
+ $c->forward('MyApp::View::TT');
}
=head2 CONFIGURATION
@@ -303,12 +303,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 +352,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 +403,7 @@
sub message : Global {
my ( $self, $c ) = @_;
$c->stash->{template} = 'message.tt2';
- $c->forward('MyApp::V::TT');
+ $c->forward('MyApp::View::TT');
}
If a stash item isn't defined, then it instead uses the
@@ -418,7 +418,7 @@
my ( $self, $c ) = @_;
$c->stash->{template} = 'message.tt2';
$c->stash->{message} = 'Hello World!';
- $c->forward('MyApp::V::TT');
+ $c->forward('MyApp::View::TT');
}
A number of other template variables are also added:
@@ -519,7 +519,7 @@
MyApp->config({
name => 'MyApp',
root => MyApp->path_to('root'),
- 'V::TT' => {
+ 'View::TT' => {
CATALYST_VAR => 'Catalyst',
},
});
@@ -566,7 +566,7 @@
MyApp->config({
name => 'MyApp',
root => MyApp->path_to('root'),
- 'V::TT' => {
+ 'View::TT' => {
PROVIDERS => [
{
name => 'DBI',