Form::Factory::Interface - Role for form interface implementations


NAME

Form::Factory::Interface - Role for form interface implementations


VERSION

version 0.014


SYNOPSIS

  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' }


DESCRIPTION

Defines the contract form interface classes must fulfill.


ATTRIBUTES

stasher

A place for remembering things.


METHODS

stash

unstash

See the Form::Factory::Stash manpage.

new_action

  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.

new_control

  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.


ROLE METHODS

The following methods need to implement the following methods.

render_control

  $interface->render_control($control, %options);

This method is used to render the control in the current form.

consume_control

  $interface->consume_control($control, %options);

This method is used to consume the values input for a current form.


CONTROLS

Here's a list of controls and the classes they represent:

button

the Form::Factory::Control::Button manpage

checkbox

the Form::Factory::Control::Checkbox manpage

full_text

the Form::Factory::Control::FullText manpage

password

the Form::Factory::Control::Password manpage

select_many

the Form::Factory::Control::SelectMany manpage

select_one

the Form::Factory::Control::SelectOne manpage

text

the Form::Factory::Control::Text manpage

value

the Form::Factory::Control::Value manpage


SEE ALSO

the Form::Factory::Action manpage, the Form::Factory::Control manpage, the Form::Factory::Stasher manpage


AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>


COPYRIGHT AND LICENSE

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.

 Form::Factory::Interface - Role for form interface implementations