NAME
Hyper::Template::HTC - class for using HTC based Hyper templates
VERSION
This document describes Hyper::Template::HTC 0.01
SYNOPSIS
use Hyper::Template::HTC;
my $template = Hyper::Template::HTC->new();
DESCRIPTION
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.
SUBROUTINES/METHODS
new
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:
- filename
-
default: undef
Full template filename.
- for_class
-
default: undef
Find Template via Class name.
Replacable parameters for internal HTML::Template::Compiled->new()
- out_fh
-
default: 1
Whether to directly output content or not. See HTML::Template::Compiled.
compiler_class
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).
output
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.
DIAGNOSTICS
CONFIGURATION AND ENVIRONMENT
DEPENDENCIES
version
HTML::Template::Compiled
Hyper
Hyper::Template
Hyper::Functions
Hyper::Singleton::Context
File::Basename
File::Spec
Readonly
INCOMPATIBILITIES
BUGS AND LIMITATIONS
RCS INFORMATIONS
- Last changed by
-
$Author: ac0v $
- Id
-
$Id: HTC.pm 317 2008-02-16 01:52:33Z ac0v $
- Revision
-
$Revision: 317 $
- Date
-
$Date: 2008-02-16 02:52:33 +0100 (Sat, 16 Feb 2008) $
- HeadURL
-
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/trunk/lib/Hyper/Template/HTC.pm $
AUTHOR
Andreas Specht <ACID@cpan.org>
LICENSE AND COPYRIGHT
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.