Taxi::Mysql::Format::Template - hit list formatter via Text::Template |
Taxi::Mysql::Format::Template - hit list formatter via Text::Template
##======================================================================== ## PRELIMINARIES
use Taxi::Mysql::Format::Template;
##======================================================================== ## Constructors etc.
$q = $CLASS_OR_OBJ->new(%args);
##======================================================================== ## Format API
$str = $obj->toString($hl); $bool = $obj->toFh($hl,$fh);
##======================================================================== ## Template API: Template acquisition
\%params = $obj->templateParams($hl, %more); $type = $fmt->templateType(); $src = $fmt->templateSource(); $template = $fmt->template();
Taxi::Mysql::Format::Template inherits from and implements the API specified by Taxi::Mysql::Format::Base.
$q = $CLASS_OR_OBJ->new(%args);
Object structure / known %args:
{ ##-- Template data templateType => $type, ##-- source type: 'FILE','ARRAY','FILEHANDLE','STRING' templateSource => $src, ##-- template source data templateParams => \%params, ##-- also: $fmt, $hl, $ix, $q templateDelim => [ $open, $close ], ##-- default: '@{', '@}'
##-- Source data (from ../Format) index => $index, ##-- underlying Taxi::Mysql object }
$str = $obj->toString($hl);
(undocumented)
$bool = $obj->toFh($hl,$fh);
(undocumented)
\%params = $obj->templateParams($hl, %more);
Should return user Text::Template parameters. Default implementation instantiates the following parameters:
$fmt ##-- the calling Taxi::Mysql::Format::Template object $hl ##-- the Taxi::Mysql::HitList object to be formatted $ix ##-- the Taxi::Mysql index associated with the formatter object $q ##-- the Taxi::Mysql::Query::Base object associated with the HitList
$type = $fmt->templateType();
TYPE argument to Text::Template->new(). Default: 'STRING'.
$src = $fmt->templateSource();
SOURCE argument to Text::Template->new(). Default: '@{ ``$hl'' @}'
$template = $fmt->template();
Gets a (new) Text::Template for formatting. Default implementation uses $fmt->{template} if defined.
Perl by Larry Wall.
Bryan Jurish <moocow@ling.uni-potsdam.de>
Copyright (C) 2006 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
perl(1), Taxi::Mysql(3perl), Taxi::Mysql::Format(3perl), Taxi::Mysql::Format::Text(3perl), Taxi::Mysql::Format::XML(3perl), Taxi::Mysql::Format::XSLT(3perl), Taxi::Mysql::Format::HTML(3perl).
Taxi::Mysql::Format::Template - hit list formatter via Text::Template |