HTML::Widget::Factory - churn out HTML widgets
version 0.063
my $factory = HTML::Widget::Factory->new(); my $html = $factory->select({ name => 'flavor', options => [ [ minty => 'Peppermint', ], [ perky => 'Fresh and Warm', ], [ super => 'Red and Blue', ], ], value => 'minty', });
HTML::Widget::Factory provides a simple, pluggable system for constructing HTML form controls.
Most of the useful methods in an HTML::Widget::Factory object will be installed there by its plugins. Consult the documentation for the HTML::Widget::Plugin modules.
my $factory = HTML::Widget::Factory->new(\%arg);
This constructor returns a new widget factory.
The only valid arguments are plugins and extra_plugins, which provide arrayrefs of plugins to be used. If plugins is not given, the default plugin list is used; this is generated by finding all modules beginning with HTML::Widget::Plugin. The plugins in extra_plugins are loaded in addition to these.
plugins
extra_plugins
This returns a list of the plugins loaded by the factory.
fixed_args for args that are fixed, like (type => 'checkbox')
a simple way to say "only include this output if you haven't before"
This will make it easy to do JavaScript inclusions: if you've already made a calendar (or whatever) widget, don't bother including this hunk of JS, for example.
giving the constructor a data store
Create a factory that has a CGI.pm object and let it default values to the param that matches the passed name.
include id attribute where needed
optional labels (before or after control, or possibly return a list)
Ricardo SIGNES <rjbs @ cpan.org>
rjbs @ cpan.org
Development was sponsored by Listbox and Pobox between 2005 and 2007.
Copyright (C) 2005-2007, Ricardo SIGNES. This is free software, released under the same terms as perl itself.
To install HTML::Widget::Factory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Widget::Factory
CPAN shell
perl -MCPAN -e shell install HTML::Widget::Factory
For more information on module installation, please visit the detailed CPAN module installation guide.