Egg::View - Common package for VIEW module.
package Egg::View::[FOO_TEMPLATE]; use strict; use base qw/Egg::View/; use [FOO_TEMPLATE_MODULE]; sub new { my $view= shift->SUPER::new(@_); ... ... ban, ban. } sub output { my($view, $e)= @_; my $config = $e->flag('VIEW_CONFIG_[FOO_TEMPLATE]') || {}; my $template= $view->template_file($e) || return; my $body= [FOO_TEMPLATE_MODULE]->output( template=> $template, option => $config, ); $e->response->body( \$body ); return 1; }
When the View module uses this, happiness can be tasted only just a little.
The parameter can be set up beforehand.
package [MYPROJECT]; use strict; use Egg::View; $Egg::View::PARAMS{param1}= 'value1'; # The set value is acquired. $e->view->param( 'param1' );
This module has succeeded to Egg::Component.
The set template is received. If Egg is debug mode, the report is sent to STDERR. When the template is not set, $e->finished(404) is returned.
Egg::Component, Egg::Release,
Masatoshi Mizuno, <mizuno@bomcity.com>
Copyright (C) 2007 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Egg::Release, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Egg::Release
CPAN shell
perl -MCPAN -e shell install Egg::Release
For more information on module installation, please visit the detailed CPAN module installation guide.