Permalink
Browse files

version 10

  • Loading branch information...
1 parent 49e6e48 commit 03a211c506f7f8a92fbc116905ebbb4ec844529a @gshank gshank committed Jan 29, 2009
Showing with 25 additions and 6 deletions.
  1. +8 −1 Changes
  2. +2 −1 META.yml
  3. +1 −0 Makefile.PL
  4. +3 −3 lib/HTML/FormHandler.pm
  5. +10 −0 lib/HTML/FormHandler/Manual/Cookbook.pod
  6. +1 −1 lib/HTML/FormHandler/Moose.pm
View
@@ -1,6 +1,13 @@
Revision history for HTML::FormHandler
-0.08 Sun Jan 25 2009, 03:00
+0.10 Thu Jan 29 2009, 07:00
+ Remove unnecessary 'use' from Render::Simple to eliminate install
+ failures. Change handling of 'has_field'.
+
+0.09 Sun Jan 25 2009, 17:00
+ Minor changes.
+
+0.08 Sat Jan 24 2009, 11:00
Remove controller and role. Refactor to support persistent
forms. Remove update_from_form method. Add 'process', and
'update' methods. Update documentation to match. Update tutorial.
View
@@ -24,11 +24,12 @@ requires:
Carp: 0
DBIx::Class: 0
DateTime: 0
+ HTML::Entities: 0
Locale::Maketext: 1.09
Moose: 0.59
MooseX::AttributeHelpers: 0.14
UNIVERSAL::require: 0
perl: 5.8.0
resources:
license: http://dev.perl.org/licenses/
-version: 0.09
+version: 0.10
View
@@ -14,6 +14,7 @@ requires 'UNIVERSAL::require' => '0';
requires 'Locale::Maketext' => '1.09';
requires 'DateTime';
requires 'DBIx::Class';
+requires 'HTML::Entities';
recommends 'Catalyst';
recommends 'Catalyst::Component::InstancePerContext';
View
@@ -179,7 +179,7 @@ or:
}
}
-Fields specified in a field_list will overwrite fields specified with 'has_field',
+Fields specified in a field_list will overwrite fields specified with 'has_field'.
=head2 field_list
@@ -262,7 +262,7 @@ will return the form name + "." + field name
=cut
-has 'html_prefix' => ( isa => 'Bool', is => 'rw', default => 0 );
+has 'html_prefix' => ( isa => 'Bool', is => 'rw' );
=head2 init_object
@@ -719,7 +719,7 @@ field objects. It calls the make_field() method for each field.
sub build_form
{
my $self = shift;
-$DB::single=1;
+
my $meta_flist = $self->meta->field_list if $self->meta->can('field_list');
my $flist = $self->field_list;
$self->_build_fields( $meta_flist, 0 ) if $meta_flist;
@@ -129,6 +129,16 @@ Or you can make these customizations Moose roles.
with 'MyApp::Form::Role::Base';
...
+=head2 Access a user record in the form
+
+You might need the user_id to create specialized select lists, or do other form processing. Add a user_id attribute to your form:
+
+ has 'user_id' => ( isa => 'Int', is => 'rw' );
+
+Then pass it in when you process the form:
+
+ $form->process( item => $item, params => $c->req->parameters, user_id = $c->user->user_id );
+
=head1 AUTHOR
@@ -38,7 +38,7 @@ sub init_meta {
sub has_field
{
my ( $class, $name, %options ) = @_;
-$DB::single=1;
+
my $value = $class->meta->field_list || [];
if( scalar @{$value} == 0 )
{

0 comments on commit 03a211c

Please sign in to comment.