CGI::Application::Plugin::PageBuilderCGI::Application::Plugin::PageBuilder is a Perl module that simplifies building pages with multiple templates. | |
Download |
CGI::Application::Plugin::PageBuilder Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Clint Moore
- Publisher web site:
- http://search.cpan.org/~cmoore/CGI-Application-Plugin-PageBuilder-0.93/PageBuilder.pm
CGI::Application::Plugin::PageBuilder Tags
CGI::Application::Plugin::PageBuilder Description
CGI::Application::Plugin::PageBuilder is a Perl module that simplifies building pages with multiple templates. CGI::Application::Plugin::PageBuilder is a Perl module that simplifies building pages with multiple templates.SYNOPSISThis module simplifies building complex web pages with many small piecemeal templates.Instead of sub run_mode { my $self = shift; my $header = $self->load_tmpl( 'header.tmpl' )->output(); my $html; my $start = $self->load_tmpl( 'view_start.tmpl' ); $start->param( view_name => 'This View' ); $html .= $start->output(); my $db = MyApp::DB::Views->retrieve_all(); # Class::DBI while ( my $line = $db->next() ) { my $template = $self->load_tmpl( 'view_element.tmpl' ); $template->param( name => $line->name() ); $template->param( info => $line->info() ); $html .= $template->output(); } $html .= $self->load_tmpl( 'view_end.tmpl' )->output(); $html .= $self->load_tmpl( 'footer.tmpl' )->output(); return $html; }You can do this: CGI:App subclass: sub run_mode { my $self = shift; $self->pb_template( 'header.tmpl' ); $self->pb_template( 'view_start.tmpl' ); my $db = MyApp::DB::Views->retrieve_all(); while( my $line = $db->next() ) { $self->pb_template( 'view_row.tmpl' ); $self->pb_param( name, $line->name() ); $self->pb_param( info, $line->info() ); } $self->pb_template( 'view_end.tmpl' ); $self->pb_template( 'footer.tmpl' ); return $self->pb_build(); } Requirements: · Perl
CGI::Application::Plugin::PageBuilder Related Software