Andreas 'ac0v' Specht > Hyper > Hyper::Template::HTC

Download:
Hyper-v0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  1
View/Report Bugs
Module Version: v0.01   Source  

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 ^

INCOMPATIBILITIES ^

BUGS AND LIMITATIONS ^

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 $

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.

syntax highlighting: