As indicated by the inline comments above, the C<META title> line uses
TT's META feature to provide a title to C<root/lib/site/header>.
-Meanwhile, the outer C<FOREACH> loop iterates through each C<book> model
-object and prints the C<title> and C<rating> fields. An inner
-C<FOREACH> loop prints the last name of each author in a comma-separated
-list within a single table cell.
+Meanwhile, the C<FOREACH> loop iterates through each C<book> model
+object and prints the C<title> and C<rating> fields.
If you are new to TT, the C<[%> and C<%]> tags are used to delimit TT
code. TT supports a wide variety of directives for "calling" other
usual range of Perl operators down to the single dot (C<.>) operator.
This applies to operations as diverse as method calls, hash lookups, and
list index values (see
-L<http://www.template-toolkit.org/docs/default/Manual/Variables.html>
+L<http://search.cpan.org/perldoc?Template::Manual::Variables>
for details and examples). In addition to the usual C<Template> module
Pod documentation, you can access the TT manual at
-L<http://www.template-toolkit.org/docs/default/>.
+L<http://search.cpan.org/perldoc?Template::Manual>.
B<NOTE:> The C<TTSite> helper creates several TT files using an
extension of C<.tt2>. Most other Catalyst and TT examples use an
<td>
[% # 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 the 'push' TT vmethod does not -%]
+ [% # authors into the list. Note that the 'push' TT vmethod does not print -%]
[% # a value, so nothing will be printed here. But, if you have something -%]
[% # in TT that does return a method and you don't want it printed, you -%]
[% # can: 1) assign it to a bogus value, or 2) use the CALL keyword to -%]
[% tt_authors.join(', ') | html %]
</td>
-Then hit C<Ctrl+R> in your browser (not that you don't need to reload
+Then hit C<Ctrl+R> in your browser (note that you don't need to reload
the development server or use the C<-r> option when updating TT
-templates) and you should now the the number of authors each book and
-a comma-separated list of the author's last names.
+templates) and you should now see the number of authors each book has
+along with a comma-separated list of the authors' last names.
If you are still running the development server with C<DBIC_TRACE>
enabled, you should also now see five more C<SELECT> statements in the
L<http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-Manual/lib/Catalyst/Manual/Tutorial/>.
Copyright 2006-2008, Kennedy Clark, under Creative Commons License
-(L<http://creativecommons.org/licenses/by-nc-sa/2.5/>).
+(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).