Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

template::timer(3pm) [debian man page]

Timer(3pm)						User Contributed Perl Documentation						Timer(3pm)

NAME
Template::Timer - Rudimentary profiling for Template Toolkit VERSION
Version 1.00 SYNOPSIS
Template::Timer provides inline timings of the template processing througout your code. It's an overridden version of Template::Context that wraps the "process()" and "include()" methods. Using Template::Timer is simple. use Template::Timer; my %config = ( # Whatever your config is INCLUDE_PATH => '/my/template/path', COMPILE_EXT => '.ttc', COMPILE_DIR => '/tmp/tt', ); if ( $development_mode ) { $config{ CONTEXT } = Template::Timer->new( %config ); } my $template = Template->new( \%config ); Now when you process templates, HTML comments will get embedded in your output, which you can easily grep for. The nesting level is also shown. <!-- TIMER START: L1 process mainmenu/mainmenu.ttml --> <!-- TIMER START: L2 include mainmenu/cssindex.tt --> <!-- TIMER START: L3 process mainmenu/cssindex.tt --> <!-- TIMER END: L3 process mainmenu/cssindex.tt (17.279 ms) --> <!-- TIMER END: L2 include mainmenu/cssindex.tt (17.401 ms) --> .... <!-- TIMER END: L3 process mainmenu/footer.tt (3.016 ms) --> <!-- TIMER END: L2 include mainmenu/footer.tt (3.104 ms) --> <!-- TIMER END: L1 process mainmenu/mainmenu.ttml (400.409 ms) --> Note that since INCLUDE is a wrapper around PROCESS, calls to INCLUDEs will be doubled up, and slightly longer than the PROCESS call. AUTHOR
Andy Lester, "<andy at petdance.com>" BUGS
Please report any bugs or feature requests to "bug-template-timer at rt.cpan.org", or through the web interface at <http://rt.cpan.org>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. ACKNOWLEDGEMENTS
Thanks to Randal Schwartz, Bill Moseley, and to Gavin Estey for the original code. COPYRIGHT &; LICENSE This library is free software; you can redistribute it and/or modify it under the terms of either the GNU Public License v3, or the Artistic License 2.0. * http://www.gnu.org/copyleft/gpl.html * http://www.opensource.org/licenses/artistic-license-2.0.php perl v5.12.4 2009-03-07 Timer(3pm)

Check Out this Related Man Page

Template::Multilingual(3pm)				User Contributed Perl Documentation			       Template::Multilingual(3pm)

NAME
Template::Multilingual - Multilingual templates for Template Toolkit SYNOPSIS
This subclass of Template Toolkit's "Template" class supports multilingual templates: templates that contain text in several languages. <t> <en>Hello!</en> <fr>Bonjour !</fr> </t> Specify the language to use when processing a template: use Template::Multilingual; my $template = Template::Multilingual->new(); $template->language('en'); $template->process('example.ttml'); You can also provide the name of the template variable that will hold the language: my $template = Template::Multilingual->new(LANGUAGE_VAR => 'foo'); $template->process('example.ttml', { foo => 'en' }); METHODS
new(\%params) The new() constructor creates and returns a reference to a new template object. A reference to a hash may be supplied as a parameter to provide configuration values. Configuration values are all valid "Template" superclass options, and one specific to this class: LANGUAGE_VAR The LANGUAGE_VAR option can be used to set the name of the template variable which contains the current language. my $parser = Template::Multilingual->new({ LANGUAGE_VAR => 'global.language', }); If this option is set, your code is responsible for setting the variable's value to the current language when processing the template. Calling "language()" will have no effect. If this option is not set, it defaults to language. language($lcode) Specify the language to be used when processing the template. Any string that matches "w+" is fine, but we suggest sticking to ISO-639 which provides 2-letter codes for common languages and 3-letter codes for many others. process Used exactly as the original Template Toolkit "process" method. Be sure to call "language" before calling "process". LANGUAGE SUBTAG HANDLING
This module supports language subtags to express variants, e.g. "en_US" or "en-US". Here are the rules used for language matching: o Exact match: the current language is found in the template language template output fr <fr>foo</fr><fr_CA>bar</fr_CA> foo fr_CA <fr>foo</fr><fr_CA>bar</fr_CA> bar o Fallback to the primary language language template output fr_CA <fr>foo</fr><fr_BE>bar</fr_BE> foo o Fallback to first (in alphabetical order) other variant of the primary language language template output fr <fr_FR>foo</fr_FR><fr_BE>bar</fr_BE> bar fr_CA <fr_FR>foo</fr_FR><fr_BE>bar</fr_BE> bar AUTHOR
Eric Cholet, "<cholet@logilune.com>" BUGS
Multilingual text sections cannot be used inside TT directives. The following is illegal and will trigger a TT syntax error: [% title = "<t><fr>Bonjour</fr><en>Hello</en></t>" %] Use this instead: [% title = BLOCK %]<t><fr>Bonjour</fr><en>Hello</en></t>[% END %] The TAG_STYLE, START_TAG and END_TAG directives are supported, but the TAGS directive is not. Please report any bugs or feature requests to "bug-template-multilingual@rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Multilingual>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SEE ALSO
If you are already using your own "Template" subclass, you may find it easier to use Template::Multilingual::Parser instead. ISO 639-2 Codes for the Representation of Names of Languages: http://www.loc.gov/standards/iso639-2/langcodes.html COPYRIGHT &; LICENSE Copyright 2009 Eric Cholet, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.0 2009-01-18 Template::Multilingual(3pm)
Man Page