functionality yourself, another option is to use a "CRUD builder" type
of tool to automate the process. You get less control, but it's quick
and easy. For example, see
-L<CatalystX::ListFramework::Builder|CatalystX::ListFramework::Builder>,
+L<Catalyst::Plugin::AutoCRUD|Catalyst::Plugin::AutoCRUD>,
L<CatalystX::CRUD|CatalystX::CRUD>, and
L<CatalystX::CRUD::YUI|CatalystX::CRUD::YUI>.
[% # authors into the list. Note that the 'push' TT vmethod doesn't return -%]
[% # a value, so nothing will be printed here. But, if you have something -%]
[% # in TT that does return a value and you don't want it printed, you can -%]
- [% # 1) assign it to a bogus value, or # 2) use the CALL keyword to -%]
- [% # call it and discard the return value. -%]
+ [% # 1) assign it to a bogus value, or -%]
+ [% # 2) use the CALL keyword to call it and discard the return value. -%]
[% tt_authors = [ ];
tt_authors.push(author.last_name) FOREACH author = book.authors %]
[% # Now use a TT 'virtual method' to display the author count in parens -%]
=head2 Create a ResultSet Class
-An often overlooked but extremely powerful features of DBIC is that it
+An often overlooked but extremely powerful feature of DBIC is that it
allows you to supply your own subclasses of C<DBIx::Class::ResultSet>.
It allows you to pull complex and unsightly "query code" out of your
controllers and encapsulate it in a method of your ResultSet Class.
1;
-Then we need to tell the Result Class to to treat this as a ResultSet
+Then we need to tell the Result Class to treat this as a ResultSet
Class. Open C<lib/MyApp/Schema/Result/Book.pm> and add the following
above the "C<1;>" at the bottom of the file:
Result Class, it keeps the code inside our .tt template nice and clean
(remember, we want the templates to be as close to pure HTML markup as
possible). Obviously, this capability becomes even more useful as you
-use to to remove even more complicated row-specific logic from your
+use to remove even more complicated row-specific logic from your
templates!
Although most of the code we removed comprised comments, the overall
effect is dramatic... because our view code is so simple, we don't
-huge comments to clue people in to the gist of our code. The view
+need huge comments to clue people in to the gist of our code. The view
code is now self-documenting and readable enough that you could
probably get by with no comments at all. All of the "complex" work is
being done in our Result Class methods (and, because we have broken
Please report any errors, issues or suggestions to the author. The
most recent version of the Catalyst Tutorial can be found at
-L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.70/trunk/lib/Catalyst/Manual/Tutorial/>.
+L<http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Manual/5.80/trunk/lib/Catalyst/Manual/Tutorial/>.
Copyright 2006-2008, Kennedy Clark, under Creative Commons License
(L<http://creativecommons.org/licenses/by-sa/3.0/us/>).