Sébastien Aperghis-Tramoni > RackMan-1.17 > RackMan::Template

Download:
RackMan-1.17.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source   Latest Release: RackMan-1.18

NAME ^

RackMan::Template - Simple templating module for RackMan

SYNOPSIS ^

    use RackMan::Template;

    my $tmpl = RackMan::Template->new(filename => "dhcp.tmpl");
    $tmpl->param(dhcp_server => "192.168.0.13");
    print $tmpl->output;

DESCRIPTION ^

This module is a simple Moose-based templating class, based on HTML::Template and HTML::Template::Filter::TT2. Please read the documentation of these modules for more details on the syntax.

METHODS ^

new

(delegated to HTML::Template)

Create and return a new object.

param

(delegated to HTML::Template)

Pass parameters to the template.

populate_from

Add to the template the parameters documented in "TEMPLATE PARAMETERS" from the Rackman::Device and RackMan objects given in argument.

    my $tmpl = RackMan::Template->new(filename => $tmpl_path);
    $tmpl->populate_from($rackdev, $rackman);

output

(delegated to HTML::Template)

Generate and return the output from the template and the given parameters.

TEMPLATE PARAMETERS ^

When the method populate_from() is called with valid RackMan::Device and Rackman objects given in arguments, it populates the template object with the following parameters:

The corresponding RackObject attributes are also available, with their names mogrified to be valid identifiers: units are removed, some punctuation characters (dot (.), comma (,)) are removed, the alphabetical characters are lowercased and the rest of non word characters are collapsed and converted to underscores (_).

Here is a non authoritative list of known attributes: alias, alive_check, contact_person, cpu, dram flash_memory, fqdn, has_jumbo_frames, hw_type, hw_warranty_expiration, hypervisor, max_power, max_current, oem_sn_1, oem_sn_2, sw_type, sw_version, sw_warranty_expiration, use, uuid.

SEE ALSO ^

HTML::Template, HTML::Template::Filter::TT2

AUTHOR ^

Sebastien Aperghis-Tramoni

syntax highlighting: