| Jifty documentation | Contained in the Jifty distribution. |
Jifty::Param - Parameters for Jifty actions
Describes a parameter to a Jifty::Action object. Do not construct
this by hand -- use Jifty::Param::Schema in the action package to
declare parameters instead.
Although this class is not derived from Jifty::Web::Form::Field, it does share the accessors from it; see Jifty::Web::Form::Field, for the list of possible keys that each parameter can have.
In addition to the list there, you may use these additional keys:
A boolean which, if set, indicates that the argument must be
present in the arguments passed to create the action, rather than
being expected to be set later.
Defaults to false.
An array reference. Each element should be either:
display field for the string to display for the
value, and a value field for the value to actually send to the server. collection field containing a Jifty::Collection,
and display_from and value_from fields containing the names of methods to
call on each record in the collection to get display and value. display and value.Just like valid_values, but represents the list of suggested values, instead of the list of acceptable values.
An integer of how the parameter sorts relative to other parameters. This is usually implicitly generated by its declaration order.
Creates a new Jifty::Param object. Note that unlike Jifty::Web::Form::Field, the object is never magically reblessed into a subclass. Should only be called implicitly from a Jifty::Param::Schema declaration.
| Jifty documentation | Contained in the Jifty distribution. |
use warnings; use strict; package Jifty::Param;
# We share accessors with Jifty::Web::Form::Field, but not its methods, # so it's not an inheritance relationsip. use Jifty::Web::Form::Field (); use base qw/Class::Accessor::Fast/; use constant ACCESSORS => ( Jifty::Web::Form::Field->accessors, qw(constructor valid_values available_values sort_order documentation), ); __PACKAGE__->mk_accessors(ACCESSORS); sub accessors { ACCESSORS }
sub new { my $class = shift; $class->Class::Accessor::Fast::new({ type => 'text', class => '', input_name => '', default_value => '', sticky_value => '', render_mode => 'update', @_, }); } 1;