[Catalyst-commits] r7887 - in
CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk: .
lib/CatalystX/CRUD/Controller
karpet at dev.catalyst.perl.org
karpet at dev.catalyst.perl.org
Tue Jun 3 22:09:33 BST 2008
Author: karpet
Date: 2008-06-03 22:09:33 +0100 (Tue, 03 Jun 2008)
New Revision: 7887
Modified:
CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes
CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm
Log:
urgh. must pass $c since no easy way to init form() at start up time.
Modified: CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes 2008-06-03 20:47:36 UTC (rev 7886)
+++ CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/Changes 2008-06-03 21:09:33 UTC (rev 7887)
@@ -47,6 +47,7 @@
0.12 xxx
* pass $c in to form->new() as value to 'app' param, as well as setting in in app() method.
this is so that $c is available to build_form() et al.
- * cache field_names() to avoid needing $c every time form() is called.
+ * field_names() now requires $c (context) be passed
+
Modified: CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm 2008-06-03 20:47:36 UTC (rev 7886)
+++ CatalystX-CRUD/CatalystX-CRUD-Controller-RHTMLO/trunk/lib/CatalystX/CRUD/Controller/RHTMLO.pm 2008-06-03 21:09:33 UTC (rev 7887)
@@ -70,21 +70,21 @@
sub form {
my ( $self, $c ) = @_;
$self->{_form} ||= $self->form_class->new( app => $c );
- $self->{_field_names} ||= $self->{_form}->field_names;
$self->{_form}->app($c) unless defined $self->{_form}->app;
$self->{_form}->clear unless $self->{_form}->app->stash->{_form_called}->{ $self->action_namespace }++;
return $self->{_form};
}
-=head2 field_names
+=head2 field_names( I<context> )
Returns an array ref of the field names in form.
=cut
sub field_names {
- my ($self) = @_;
- return $self->{_field_names};
+ my ($self, $c) = @_;
+ $self->throw_error("context required") unless defined $c;
+ return $self->form($c)->field_names;
}
=head2 all_form_errors
More information about the Catalyst-commits
mailing list