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=8c166dd5119ac21ce3a0fc91eaba92054a4b9775;hp=120db49c7dab5458526c5144f7db65f1f157ac60;hb=02bb2b5a140dc22d7d002fcdce868656d704676a;hpb=388f66e0214312ffa77b48128d2fa2e1932b4669 diff --git a/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod b/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod index 120db49..8c166dd 100644 --- a/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod +++ b/lib/Catalyst/Manual/Tutorial/04_BasicCRUD.pod @@ -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 -%] @@ -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 %] ...