Permalink
Browse files

Add template for /books/list action

  • Loading branch information...
phillipadsmith committed Aug 15, 2011
1 parent 33a2527 commit 268cac856cdaa1995a15f4f83da3abe2f91d40ab
Showing with 26 additions and 0 deletions.
  1. +6 −0 lib/Catalyst/Default.pm
  2. +20 −0 root/src/books/list.tt2
View
@@ -40,6 +40,12 @@ __PACKAGE__->config(
name => 'Catalyst::Default',
# Disable deprecated behavior needed by old applications
disable_component_resolution_regex_fallback => 1,
'View::HTML' => {
#Set the location for TT files
INCLUDE_PATH => [
__PACKAGE__->path_to( 'root', 'src' ),
],
},
);
# Start the application
View
@@ -0,0 +1,20 @@
[% # This is a TT comment. The '-' at the end "chomps" the newline. You won't -%]
[% # see this "chomping" in your browser because HTML ignores blank lines, but -%]
[% # it WILL eliminate a blank line if you view the HTML source. It's purely -%]
[%- # optional, but both the beginning and the ending TT tags support chomping. -%]
[% # Provide a title -%]
[% META title = 'Book List' -%]
<table>
<tr><th>Title</th><th>Rating</th><th>Author(s)</th></tr>
[% # Display each book in a table row %]
[% FOREACH book IN books -%]
<tr>
<td>[% book.title %]</td>
<td>[% book.rating %]</td>
<td></td>
</tr>
[% END -%]
</table>

0 comments on commit 268cac8

Please sign in to comment.