X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FTutorial%2F04_BasicCRUD.pod;h=6c0ef54bfe3b37614447c7008dba05652eb54bd5;hp=36a3525df82f7f2c8ec8cb8b48a5e83ccf7fdd42;hb=e8200f38d465b85ad84eb11718db1e61230ce73b;hpb=f4e9de4a3171fd75d04fa8e294fd9a0ae367bc18 diff --git a/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod b/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod index 36a3525..6c0ef54 100644 --- a/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod +++ b/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod @@ -310,7 +310,7 @@ Link to previous part of the chain with C<:Chained('_name_')> =item * -B," use "C" instead to end a chain> +B<< Do NOT get arguments through "C," use "C" instead to end a chain >> =item * @@ -507,9 +507,9 @@ Open F in your editor and enter:
- - - + + +
Title:
Rating:
Author ID:
Title:
Rating:
Author ID:
@@ -609,32 +609,32 @@ header, and 2) the five lines for the Delete link near the bottom): TitleRatingAuthor(s)Links [% # Display each book in a table row %] [% FOREACH book IN books -%] - - [% book.title %] - [% book.rating %] - - [% # NOTE: See Chapter 4 for a better way to do this! -%] - [% # 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 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 -%] - [% # 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 -%] - [% # Note the use of the TT filter "| html" to escape dangerous characters -%] - ([% tt_authors.size | html %]) - [% # Use another TT vmethod to join & print the names & comma separators -%] - [% tt_authors.join(', ') | html %] - - - [% # Add a link to delete a book %] - Delete - - + + [% book.title %] + [% book.rating %] + + [% # NOTE: See Chapter 4 for a better way to do this! -%] + [% # 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 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 -%] + [% # 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 -%] + [% # Note the use of the TT filter "| html" to escape dangerous characters -%] + ([% tt_authors.size | html %]) + [% # Use another TT vmethod to join & print the names & comma separators -%] + [% tt_authors.join(', ') | html %] + + + [% # Add a link to delete a book %] + Delete + + [% END -%] @@ -1044,7 +1044,7 @@ incorporate the datetime logic: =head2 Create a ResultSet Class An often overlooked but extremely powerful features of DBIC is that it -allows you to supply your own subclasses of C. +allows you to supply your own subclasses of L. This can be used to pull complex and unsightly "query code" out of your controllers and encapsulate it in a method of your ResultSet Class. These "canned queries" in your ResultSet Class can then be invoked via a @@ -1120,7 +1120,7 @@ higher or lower value for the minutes. =head2 Chaining ResultSets -One of the most helpful and powerful features in C is that +One of the most helpful and powerful features in L is that it allows you to "chain together" a series of queries (note that this has nothing to do with the "Chained Dispatch" for Catalyst that we were discussing earlier). Because each ResultSet method returns another @@ -1296,21 +1296,21 @@ F): ... - [% # NOTE: See Chapter 4 for a better way to do this! -%] - [% # 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 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 -%] - [% # call it and discard the return value. -%] - [% tt_authors = [ ]; - tt_authors.push(author.full_name) FOREACH author = book.authors %] - [% # Now use a TT 'virtual method' to display the author count in parens -%] - [% # Note the use of the TT filter "| html" to escape dangerous characters -%] - ([% tt_authors.size | html %]) - [% # Use another TT vmethod to join & print the names & comma separators -%] - [% tt_authors.join(', ') | html %] + [% # NOTE: See Chapter 4 for a better way to do this! -%] + [% # 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 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 -%] + [% # call it and discard the return value. -%] + [% tt_authors = [ ]; + tt_authors.push(author.full_name) FOREACH author = book.authors %] + [% # Now use a TT 'virtual method' to display the author count in parens -%] + [% # Note the use of the TT filter "| html" to escape dangerous characters -%] + ([% tt_authors.size | html %]) + [% # Use another TT vmethod to join & print the names & comma separators -%] + [% tt_authors.join(', ') | html %] ... @@ -1365,8 +1365,8 @@ match the following: ... - [% # Print count and author list using Result Class methods -%] - ([% book.author_count | html %]) [% book.author_list | html %] + [% # Print count and author list using Result Class methods -%] + ([% book.author_count | html %]) [% book.author_list | html %] ...