Hyper::Template::HTC::Plugin::Text - Plugin to connect Hyper Translators to HTC
This document describes Hyper::Template::HTC::Plugin::Text 0.01
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();
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).
<%TEXT VALUE="some static text" %>
<%TEXT a.var %>
<%TEXT VALUE="Hello [_1]!" _1="Damian" %>
<%TEXT VALUE="Hello [_1]!" _1_VAR="var.with.the.value" %>
<%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" %>
Callback which is used by HTML::Template::Compiled to register the plugin.
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 } );
Internally used to lookup variables in HTML::Template::Compiled
Use Hyper::Singleton::Context for your configuration.
version
Hyper::Error
Hyper::Functions
Hyper::Singleton::Context
HTML::Template::Compiled
HTML::Template::Compiled::Token
$Author: ac0v $
$Id: Text.pm 317 2008-02-16 01:52:33Z ac0v $
$Revision: 317 $
$Date: 2008-02-16 02:52:33 +0100 (Sa, 16 Feb 2008) $
$HeadURL: http://svn.hyper-framework.org/Hyper/Hyper/tags/0.05/lib/Hyper/Template/HTC/Plugin/Text.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.