[Jifty-commit] r2430 - in jifty/trunk: lib/Jifty/Web/Form
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Dec 27 11:29:27 EST 2006
Author: falcone
Date: Wed Dec 27 11:29:26 2006
New Revision: 2430
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Web/Form/Field.pm
Log:
r15372 at ketch: falcone | 2006-12-27 11:25:21 -0500
* Jifty::Param::Schema allows "hints are 'type stuff'" but our Model syntax
uses 'are' to build an arrayref, so "hints are 'type stuff'" in a model would
result in displaying ARRAY(0x123456).
This lets you avoid saying "hints is "type stuff'"
Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm Wed Dec 27 11:29:26 2006
@@ -244,6 +244,25 @@
}
+=head2 hints [VALUE]
+
+Hints for the user to explain this field
+
+=cut
+
+sub hints {
+ my $self = shift;
+ my $hint = shift;
+
+ return $self->_hints_accessor unless $hint;
+
+ # people sometimes say hints are "foo" rather than hints is "foo"
+ if (ref $hint eq 'ARRAY') {
+ $hint = shift @$hint;
+ }
+ return $self->_hints_accessor($hint);
+}
+
=head2 element_id
More information about the Jifty-commit
mailing list