Form::Factory::Interface - Role for form interface implementations
version 0.020
package MyApp::Interface::MyUI; use Moose; with qw( Form::Factory::Interface ); sub render_control { my ($self, $control, %options) = @_; # Draw $control for user } sub consume_control { my ($self, $control, %options) = @_; # Consume values from user to fill $control } package Form::Factory::Interface::Custom::MyUI; sub register_implementation { 'MyApp::Interface::MyUI' }
Defines the contract form interface classes must fulfill.
A place for remembering things.
See Form::Factory::Stash.
my $action = $interface->new_action('Some::Action::Class', \%options);
Given the name of an action class, it initializes the class for use with this interface. The %options are passed to the constructor.
%options
my $control = $interface->new_control($name, \%options);
Given the short name for a control and a hash reference of initialization arguments, return a fully initialized control.
The following methods need to implement the following methods.
$interface->render_control($control, %options);
This method is used to render the control in the current form.
$interface->consume_control($control, %options);
This method is used to consume the values input for a current form.
Here's a list of controls and the classes they represent:
Form::Factory::Control::Button
Form::Factory::Control::Checkbox
Form::Factory::Control::FullText
Form::Factory::Control::Password
Form::Factory::Control::SelectMany
Form::Factory::Control::SelectOne
Form::Factory::Control::Text
Form::Factory::Control::Value
Form::Factory::Action, Form::Factory::Control, Form::Factory::Stasher
Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>
<hanenkamp@cpan.org>
Copyright 2009 Qubling Software LLC.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.
To install Form::Factory, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Form::Factory
CPAN shell
perl -MCPAN -e shell install Form::Factory
For more information on module installation, please visit the detailed CPAN module installation guide.