Permalink
Browse files

Add `/books/list` template.

  • Loading branch information...
1 parent 2f03598 commit 6be5e58ad4b7fe8feae91262d122cda6f618c04e @theory committed Nov 6, 2009
Showing with 18 additions and 0 deletions.
  1. +18 −0 lib/MyApp/Templates/HTML/Books.pm
@@ -5,6 +5,24 @@ use warnings;
use parent 'Template::Declare::Catalyst';
use Template::Declare::Tags;
+template list => sub {
+ my ($self, $args) = @_;
+ table {
+ row {
+ th { 'Title' };
+ th { 'Rating' };
+ th { 'Author' };
+ };
+ for my $book (@{ $args->{books} }) {
+ row {
+ cell { $book->{title} };
+ cell { $book->{rating} };
+ cell { $book->{author} };
+ };
+ }
+ };
+};
+
=head1 NAME
MyApp::Templates::HTML::Books - HTML::Books templates for MyApp

0 comments on commit 6be5e58

Please sign in to comment.