The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IWL::Environment - An environment pseudo-object

INHERITANCE

IWL::Error -> IWL::Object -> IWL::Environment

DESCRIPTION

The IWL::Environment provides a pseudo-object, used to manage snippets of IWL::Objects for a page. Its main purpose is managing shared resources, such as javascript files, whenever IWL::Page is not used. Unlike IWL::Page, IWL::Environment does not produce any code, only the code of its children.

SINOPSYS

 use IWL;
 use IWL::Environment;

 my $env = IWL::Environment->new;

 # Building some IWL hierarchy
 my $container = IWL::Container->new;
 my $label = IWL::Label->new;
 my $button = IWL::Button->new;

 $label->setText('This button does not do anything');
 $button->setLabel('Click me!');
 $container->appendChild($label, $button);

 $env->appendChild($container);

 ...

 # Print out the env content,
 # as was as any shared resource (in this case, 'button.js')
 # The environment child stack is cleared
 $html .= $env->getContent;

 ...

 my $button2 = IWL::Button->newFromStock('IWL_STOCK_NEW');
 $env->appendChild($button2);

 ...

 # Print out only $button2, since the previous content was
 # already obtained. The shared resource, 'button.js',
 # is not printed again.
 $html .= $env->getContent;

 ...

 # Adding scripts as shared resources
 $env->requiredJs('/foo/bar.js');

 $html .= $env->getContent;

CONSTRUCTOR

IWL::Environment->new ([%ARGS])

Where %ARGS is an optional hash parameter with with key-values.

METHODS

getContent

Returns the markup for the environment's children, and removes them from its stack.

getObject

Returns the environment's children as a new object, with a structure needed for JSON

LICENCE AND COPYRIGHT

Copyright (c) 2006-2008 Viktor Kojouharov. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perldoc perlartistic.

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 130:

You forgot a '=back' before '=head1'