Catalyst::View::HTML::Template::Compiled - HTML::Template::Compiled View Class
# use the helper script/myapp_create.pl view HTML::Template::Compiled HTML::Template::Compiled # lib/MyApp/View/HTML/Template.pm package MyApp::View::HTML::Template::Compiled; use base 'Catalyst::View::HTML::Template::Compiled'; __PACKAGE__->config( use_default_path => 0, # defaults to 1 # any HTML::Template::Compiled configurations items go here # see HTML::Template::Compiled documentation for more details ); 1; # Meanwhile, maybe in an 'end' action $c->forward('MyApp::View::HTML::Template::Compiled');
This is the HTML::Template::Compiled view class. Your subclass should inherit from this class.
HTML::Template::Compiled
Internally used by Catalyst. Used to configure some internal stuff.
Catalyst
Renders the template specified in $c-stash->{template} >, $c-request->match >, $c-config->{template}->{filename} > or __PACKAGE__-config->{filename} >.
Template params are set up from the contents of $c-stash >, augmented with base set to $c-req->base >, name to $c-config->{name} > and c to $c . Output is stored in $c-response->body >.
base
Pretty much the first thing called by process . Only used for sub-classing. Return a i<true>-value if everything is okay, otherwise process will fail.
Will be called right before process finishes. Only used for sub-classing. Whatever it returns, process will return.
Creates the HTML::Template::Compiled object. On success, returns the filename to be rendered; undef otherwise.
Accessor to the HTML::Template::Compiled object. May returns undef then the object has not yet been created or creating has failed.
First thing before render is called. Assigns the parameters like the ones from the stash.
render
This is where the rendering magic happens. Returns the rendered output on success, or undef otherwise.
Tries to find the right template to render. Returns its filename or undef. Actually only used internally.
Returns a array ref with paths used to find the templates in.
use_default_path: if set, will include $c->config->{root} and $c->config->{root} . '/base' to look for the template. Defaults to 1.
use_default_path
This also allows your view subclass to pass additional settings to the HTML::Template::Compiled config hash.
A list of names that are used to locate configuration parameters for the view inside $c-config >.
$c-
Normally all methods are called with the $c as the first parameter. Just to insure that you have it as a method it case you need it. :) Will be initializes by new .
new
HTML::Template::Compiled, Catalyst, Catalyst::Base.
Sascha Kiefer, esskar@cpan.org
esskar@cpan.org
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::View::HTML::Template::Compiled, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::View::HTML::Template::Compiled
CPAN shell
perl -MCPAN -e shell install Catalyst::View::HTML::Template::Compiled
For more information on module installation, please visit the detailed CPAN module installation guide.