Hyper::Template::HTC - class for using HTC based Hyper templates
This document describes Hyper::Template::HTC 0.01
use Hyper::Template::HTC; my $template = Hyper::Template::HTC->new();
Hyper::Template::HTC inherits from HTML::Template::Compiled, sets some default params for HTC and gets the filename of the template via translating the caller package name to a filename.
use Hyper::Template::HTC; Hyper::Template::HTC->new( filename => '/srv/web/www.example.com/var/sample.htc' );
or
Hyper::Template::HTC->new( out_fh => 0, for_class => 'Hyper::Control::Base::BInput', );
If the for_class parameter was set and there was no filename parameter we try to get the filename of the template via the _class_to_file method of Hyper::Functions.
You have to set at least one of the following two parameters:
default: undef
Full template filename.
Find Template via Class name.
Replacable parameters for internal HTML::Template::Compiled->new()
default: 1
Whether to directly output content or not. See HTML::Template::Compiled.
Used for setting Hypers special HTC Compiler "Class Hyper::Template::HTC::Compiler" which is used to workaround some HTC bugs (see CPANs RT for details).
use Hyper::Template::HTC; my $template = Hyper::Template::HTC->new( for_class => 'Any::Thing', out_fh => 0, ); my $output_string = $template->output();
Output is dispatched directly to HTML::Template::Compiled's output method.
use Hyper::Template::HTC; my $template = Hyper::Template::HTC->new( for_class => 'Any::Thing', out_fh => 1, ); $template->output(); # eq $template->output(Hyper->singleton()->get_output_handle()); # with own filehandle $template->output(IO::Scalar->new());
All warnings will be disabled cause of a problem with IO::Scalar. HTML::Template::Compiled's output method is called with filehandle from args or with Hyper's global output handle as default if out_fh is set.
version
HTML::Template::Compiled
Hyper
Hyper::Template
Hyper::Functions
File::Basename
File::Spec
Readonly
$Author: ac0v $
$Id: HTC.pm 433 2008-04-30 01:56:24Z ac0v $
$Revision: 433 $
$Date: 2008-04-30 03:56:24 +0200 (Mi, 30 Apr 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Template/HTC.pm $
Andreas Specht <ACID@cpan.org>
<ACID@cpan.org>
Copyright (c) 2007, Andreas Specht <ACID@cpan.org>. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Hyper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hyper
CPAN shell
perl -MCPAN -e shell install Hyper
For more information on module installation, please visit the detailed CPAN module installation guide.