[Jifty-commit] r1641 - in jifty/branches/moose: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jul 21 11:52:15 EDT 2006


Author: audreyt
Date: Fri Jul 21 11:52:15 2006
New Revision: 1641

Modified:
   jifty/branches/moose/   (props changed)
   jifty/branches/moose/lib/Jifty/Param.pm

Log:
 r16471 at T (orig r1640):  audreyt | 2006-07-21 10:45:56 -0400
 * oops, forgot to add Jifty::Param to commit.
   clkao++ audreyt--


Modified: jifty/branches/moose/lib/Jifty/Param.pm
==============================================================================
--- jifty/branches/moose/lib/Jifty/Param.pm	(original)
+++ jifty/branches/moose/lib/Jifty/Param.pm	Fri Jul 21 11:52:15 2006
@@ -9,6 +9,61 @@
 
 =head1 DESCRIPTION
 
+Describes a parameter to a C<Jifty::Action> object.  Do not construct
+this by hand -- use L<Jifty::Param::Schema> in the action package to
+declare parameters instead.
+
+=head2 accessors
+
+See L<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:
+
+=over
+
+=item constructor
+
+A boolean which, if set, indicates that the argument B<must> be
+present in the C<arguments> passed to create the action, rather than
+being expected to be set later.
+
+Defaults to false.
+
+=item valid_values
+
+An array reference.  Each element should be either:
+
+=over 4
+
+=item *
+
+A hash reference with a C<display> field for the string to display for the
+value, and a C<value> field for the value to actually send to the server.
+
+=item *
+
+A hash reference with a C<collection> field containing a L<Jifty::Collection>,
+and C<display_from> and C<value_from> fields containing the names of methods to
+call on each record in the collection to get C<display> and C<value>.
+
+=item *
+
+A simple string, which is treated as both C<display> and C<value>.
+
+=back
+
+=item available_values
+
+Just like L<valid_values>, but represents the list of suggested values,
+instead of the list of acceptable values.
+
+=item sort_order
+
+An integer of how the parameter sorts relative to other parameters.
+This is usually implicitly generated by its declaration order.
+
+=back
+
 =cut
 
 
@@ -20,6 +75,16 @@
 has sort_order          => qw( is rw isa Int );
 no Moose;
 
+=head2 BUILDALL
+
+Controls the logic of creating a new L<Jifty::Param> object.  Note that
+unlike L<Jifty::Web::Form::Field>, the object is never magically reblessed
+into a subclass.
+
+Should only be called implicitly from a L<Jifty::Param::Schema> declaration.
+
+=cut
+
 # Inhibit the reblessing inherent in Jifty::Web::Form::Field->BUILD
 sub BUILDALL { 1; }
 


More information about the Jifty-commit mailing list