X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2FCatalystBasics.pod;h=43f6344b2588fe99b52c814502bc3866d55d9559;hb=8c7de3d51d592dc104eb714fb9c9864766dd1b7a;hp=e9b881876c545ea6b7bba0c6dbf032c313aab255;hpb=14e6feb01143a9dcaff3402fa1ae81caea84cd97;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod b/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod index e9b8818..43f6344 100644 --- a/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod +++ b/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod @@ -715,7 +715,8 @@ context object in templates from its usual C to C. When looking at other Catalyst examples, remember that they almost always use C. Note that Catalyst and TT I when you use the wrong name to access the context object...TT simply outputs blanks for -that bogus logic. Finally, be aware that this change in name I +that bogus logic (see next tip to change this behavior with TT C +options). Finally, be aware that this change in name I applies to how the context object is accessed inside your TT templates; your controllers will continue to use C<$c> (or whatever name you use when fetching the reference from C<@_> inside your methods). (You can @@ -725,6 +726,25 @@ C and C. If you do this, be careful not to have a collision between your own C variable and the Catalyst C variable.) +B: When troubleshooting TT it can be helpful to enable variable +C options. You can do this in a Catalyst environment by adding +a C line to the C<__PACKAGE__->config> declaration in +C: + + __PACKAGE__->config({ + CATALYST_VAR => 'Catalyst', + ... + DEBUG => 'undef', + ... + }); + +There are a variety of options you can use, such as 'undef', 'all', +'service', 'context', 'parser', 'provider', and 'service'. See +L for more information (remove the C +portion of the name shown in the TT docs and convert to lower case +for use inside Catalyst). + + =head2 Globally Customize Every View When using TTSite, files in the subdirectories of C can be @@ -786,10 +806,10 @@ Then open C in your editor and enter: [% # First initialize a TT variable to hold a list. Then use a TT FOREACH -%] [% # loop in 'side effect notation' to load just the last names of the -%] - [% # authors into the list. Note that we are making a bogus assignment to -%] - [% # the 'xx' vbl to avoid printing the size of the list after each push. -%] + [% # authors into the list. Note that we make a bogus assignment to the -%] + [% # 'unused' vbl to avoid printing the size of the list after each push. -%] [% tt_authors = [ ]; - xx = tt_authors.push(author.last_name) FOREACH author = book.authors %] + unused = tt_authors.push(author.last_name) FOREACH author = book.authors %] [% # Now use a TT 'virtual method' to display the author count in parens -%] ([% tt_authors.size %]) [% # Use another vmethod to join & print the names with comma separators -%]