NAME

Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC

VERSION

This document describes Hyper::Template::HTC::Plugin::Text 0.01

SYNOPSIS

ATTENTION: You always need a valid Hyper::Singleton::Context for this plugin.

use HTML::Template::Compiled;
my $htc = HTML::Template::Compiled->new(
    plugin    => [qw(Hyper::Template::HTC::Plugin::Text)],
    scalarref => \'<%TEXT VALUE="Hello World!" %>',
);
$htc->output();

DESCRIPTION

Hyper::Template::HTC::Plugin::Text connects Hyper::Translators to HTML::Template::Compiled. The Plugin allows you to create multilingual templates including maketext features (assumed that your Translator supports this).

SYNTAX

static text values
<%TEXT VALUE="some static text" %>
text from a variable
<%TEXT a.var %>
maketext with an static value
<%TEXT VALUE="Hello [_1]!" _1="Damian" %>
maketext with an variable
<%TEXT VALUE="Hello [_1]!" _1_VAR="var.with.the.value" %>
mixed samples
<%TEXT a.text _1="Damian" _2="Conway" %>

<%TEXT VALUE="[_1] has [_2] points!" _1="Larry" _2_VAR="var.with.points" %>

<%TEXT a.complex.text _1="Larry" _2="Wall" _3_VAR="var.with.points" %>

SUBROUTINES/METHODS

register

Callback which is used by HTML::Template::Compiled to register the plugin.

TEXT

Don't call this method, it's used to create the HTC Template Code. This method is used as callback which is registerd to HTML::Template::Compiled by our register method.

It calls the translate method of the Translator found via

Hyper::Singleton::Context->singleton()->get_config('Class')->get_translator()

The translate method is called like

$translator_class->translate(
    'result of variable lookup or VALUE', {
        maketext => [],       # maketext params from eg. _1 _2_VAR
        escape   => ['WIKI'], # escape eg. ESCAPE="WIKI" or ESCAPE="HTML|TEXTILE" etc.
        filename => '',       # template's filename or undef if no filename existant
    }
);

_lookup_variable

Internally used to lookup variables in HTML::Template::Compiled

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

Use Hyper::Singleton::Context for your configuration.

DEPENDENCIES

INCOMPATIBILITIES

BUGS AND LIMITATIONS

RCS INFORMATIONS

Last changed by

$Author: ac0v $

Id

$Id: Text.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/Plugin/Text.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.