HTML::Template::Plugin::Dot::Helpers - Add useful objects to your templates


HTML-Template-Plugin-Dot-Helpers documentation Contained in the HTML-Template-Plugin-Dot-Helpers distribution.

Index


Code Index:

NAME

Top

HTML::Template::Plugin::Dot::Helpers - Add useful objects to your templates

VERSION

Top

Version 0.04

SYNOPSIS

Top

  use HTML::Template::Plugin::Dot::Helpers;

Then in your template, you can do:

  <tmpl_var Number.format_currency(orderitem.price)>

DESCRIPTION

Top

This helper class adds some useful objects to your Dot-enabled templates (see HTML::Template::Plugin::Dot).

Added objects

Number

An extended Number::Format object. See Number::Format for documentation. Note that only the object oriented methods are supported here.

I've added several generic numerical methods. Most (well, all in this release) are boolean methods, useful in <tmpl_if>s. They are:

equals - test whether two numbers are equal (==)
le, lt, ge, gt - test how two numbers compare

(implemented with <=, <, >=, > respectively)

The following is not yet implemented.

String

Adds generic string testing functions similar to the above:

equals - test whether two strings are equal (eq)
le, lt, ge, gt - test how two strings compare lexically

AUTHOR

Top

Rhesa Rozendaal, <rhesa@cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-html-template-plugin-dot-helpers@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Template-Plugin-Dot-Helpers. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


HTML-Template-Plugin-Dot-Helpers documentation Contained in the HTML-Template-Plugin-Dot-Helpers distribution.
package HTML::Template::Plugin::Dot::Helpers;

use warnings;
use strict;

use HTML::Template::Pluggable;
use HTML::Template::Plugin::Dot::Helpers::Number;

HTML::Template::Pluggable->add_trigger('before_output' => sub {
	my $self = shift;
	$self->param('Number' => HTML::Template::Plugin::Dot::Helpers::Number->new);
});

our $VERSION = '0.04';

1; # End of HTML::Template::Plugin::Dot::Helpers