Andreas J. König > Apache-HeavyCGI-0.013302 > Apache::HeavyCGI::Layout

Download:
Apache-HeavyCGI-0.013302.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.002   Source  

NAME ^

Apache::HeavyCGI::Layout - Represent a page layout in an array

SYNOPSIS ^

 my $layout = Apache::HeavyCGI::Layout->new(@array);

 $layout->prejoin;  # make the array more compact

 my @array = $layout->content;
 my $string = $layout->as_string($object);

DESCRIPTION ^

The constructor new() takes as an argument an array of elements. Elements may be strings and objects in any order.

The content() method returns the array of elements.

The prejoin() method joins adjacent string elements, leaving at most one string element between objects in the array.

The as_string() method takes an object, say $mgr, as an argument and joins all elements of the array such that all chunks that represent an object are called with

    $chunk->as_string($mgr)

and all chunks that represent a string are fillers in between. Objects that do not understand the as_string method are just filled in as strings, leaving room for debugging or overloading or whatever.

syntax highlighting: