[Jifty-commit] r1736 - in jifty/trunk: lib/Jifty/Web/Form

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Aug 3 01:56:21 EDT 2006


Author: trs
Date: Thu Aug  3 01:56:21 2006
New Revision: 1736

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Web/Form/Field.pm
   jifty/trunk/lib/Jifty/Web/Form/Link.pm

Log:
 r15052 at zot:  tom | 2006-08-03 01:56:04 -0400
 Inline my last commit message about needing to use anon subs for overload


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	Thu Aug  3 01:56:21 2006
@@ -46,6 +46,9 @@
 
 use Scalar::Util;
 use HTML::Entities;
+
+# We need the anonymous sub because otherwise the method of the base class is
+# always called, instead of the appropriate overridden method in a child class.
 use overload '""' => sub { shift->render }, bool => sub { 1 };
 
 =head2 new

Modified: jifty/trunk/lib/Jifty/Web/Form/Link.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Link.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Link.pm	Thu Aug  3 01:56:21 2006
@@ -17,7 +17,10 @@
 
 use base 'Jifty::Web::Form::Element';
 
-# Since we don't inherit from Form::Field, we don't otherwise stringify
+# Since we don't inherit from Form::Field, we don't otherwise stringify.
+# We need the anonymous sub because otherwise the method of the base class is
+# always called, instead of the appropriate overridden method in a possible
+# child class.
 use overload '""' => sub { shift->render }, bool => sub { 1 };
 
 =head2 accessors


More information about the Jifty-commit mailing list