Hyper::Template::HTC - class for using HTC based Hyper templates


Back to Top


NAME

Hyper::Template::HTC - class for using HTC based Hyper templates

Back to Top


VERSION

This document describes Hyper::Template::HTC 0.01

Back to Top


SYNOPSIS

    use Hyper::Template::HTC;
    my $template = Hyper::Template::HTC->new();

Back to Top


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.

Back to Top


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 the HTML::Template::Compiled manpage.

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 the HTML::Template::Compiled manpage'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. the HTML::Template::Compiled manpage's output method is called with filehandle from args or with Hyper's global output handle as default if out_fh is set.

Back to Top


DIAGNOSTICS

Back to Top


CONFIGURATION AND ENVIRONMENT

Back to Top


DEPENDENCIES

Back to Top


INCOMPATIBILITIES

Back to Top


BUGS AND LIMITATIONS

Back to Top


RCS INFORMATIONS

Last changed by

$Author: ac0v $

Id

$Id: HTC.pm 433 2008-04-30 01:56:24Z ac0v $

Revision

$Revision: 433 $

Date

$Date: 2008-04-30 03:56:24 +0200 (Mi, 30 Apr 2008) $

HeadURL

$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Template/HTC.pm $

Back to Top


AUTHOR

Andreas Specht <ACID@cpan.org>

Back to Top


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.

Back to Top

 Hyper::Template::HTC - class for using HTC based Hyper templates