Andrew Sterling Hanenkamp

NAME

Form::Factory::Action::Meta::Attribute::Control - Form control attribute-traits

VERSION

version 0.020

SYNOPSIS

  package MyApp::Action::Foo;
  use Form::Factory::Processor;

  has_control name => (
      control   => 'text',
      placement => 1,
      options   => {
          label => 'The Name',
      },
      features  => {
          required => 1,
          length   => {
              maximum => '20',
          },
      },
  );

DESCRIPTION

Any control attribute created with the "has_control" in Form::Factory::Processor subroutine, will have this trait assigned.

ATTRIBUTES

placement

This is the sort order of the controls in an action. Normally, controls will be sorted in the order they appear in the class definition, but this lets you modify that. This is mostly useful when an action is composed of different roles or inherits controls from a parent class. This allows you to order your controls relative to the controls defined in the other classes.

control

This is the short name of the control. See "CONTROLS" in Form::Factory::Interface for a list of built-in controls.

options

This is a hash of options to pass to the control constructor.

features

This is a hash of feature definitions to attach ot the control. Each key is the short name of a control-feature to attach. The value is either a "1" to indicate no additional arguments or a hash reference of arguments to pass to the feature's constructor.

METHODS

new

Makes sure that features are setup properly.

clone_and_inherit_options

Modifies the Moose::Meta::Attribute version to handle the merging of features.

SEE ALSO

Form::Factory::Processor

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.