Data-Tubes
view release on metacpan or search on metacpan
lib/Data/Tubes/Plugin/Renderer.pod view on Meta::CPAN
with checks or not (see L<Template::Perlish/compile>), it might actually
ignore C<variables> or C<template_perlish>'s variables or not. If you go
this route, it is usually a good idea to pass the L<Template::Perlish>
instance that compiled this template via argument C<template_perlish>;
=item *
an array reference. This will be expanded into an argument list for
L<Data::Tubes::Plugin::Util/read_file>, that allows reading the template
from a file (or whatever can be C<open>ed, like a scalar reference).
=item *
a code reference. This is provided for maximum flexibility. It will be
invoked to get the template, getting the full arguments hash as input
(the arguments has will always have C<template_perlish> populated,
either with the provided value or with a newly created one). It can
return either of the above, and the return value will be treated
accordingly (it I<cannot> return another code reference though, please
do all the indirections in the sub yourself!).
=back
This is the I<main> parameter, so it can be provided I<un-named> as the
first stand-alone argument.
=item C<template_input>
optional identifier of a field in the input record that has the template
to be expanded. When this argument is defined, and the corresponding
field in the input record is defined too, this field in the input record
will be used as template instead of argument C<template>. Defaults to
C<undef>, i.e. use whatever set as C<template>;
=item C<template_perlish>
an instance of L<Template::Perlish> that has to be used for all
compilations and evaluation of templates. If this is present, options
C<start>, C<stop> and C<variables> will be ignored; otherwise, a
L<Template::Perlish> instance will be created with these three
parameters;
=item C<template_perlish_input>
optional identifier of a field in the input record that has the
L<Template::Perlish> instance to use for expansions. If this argument is
missing/undefined, or if the corresponding field in the input record is
missing/undefined, the default L<Template::Perlish> instance will be
used (i.e. either the one passed with C<template_perlish>, or the
auto-generated one). Defauts to C<undef>, i.e. use whatever set as
C<template_perlish> or the auto-generated instance;
=item C<variables>
hash reference with variables that will always be available when
expanding the template. Defaults to the empty hash. Will be ignored if
C<template_perlish> is present in the arguments.
=back
=head1 BUGS AND LIMITATIONS
Report bugs either through RT or GitHub (patches welcome).
=head1 AUTHOR
Flavio Poletti <polettix@cpan.org>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2016 by Flavio Poletti <polettix@cpan.org>
This module is free software. You can redistribute it and/or modify it
under the terms of the Artistic License 2.0.
This program is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of
merchantability or fitness for a particular purpose.
=cut
( run in 1.038 second using v1.01-cache-2.11-cpan-39bf76dae61 )