Skip to content

Commit

Permalink
version 10
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Jan 29, 2009
1 parent 49e6e48 commit 03a211c
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 6 deletions.
9 changes: 8 additions & 1 deletion Changes
@@ -1,6 +1,13 @@
Revision history for HTML::FormHandler 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 Remove controller and role. Refactor to support persistent
forms. Remove update_from_form method. Add 'process', and forms. Remove update_from_form method. Add 'process', and
'update' methods. Update documentation to match. Update tutorial. 'update' methods. Update documentation to match. Update tutorial.
Expand Down
3 changes: 2 additions & 1 deletion META.yml
Expand Up @@ -24,11 +24,12 @@ requires:
Carp: 0 Carp: 0
DBIx::Class: 0 DBIx::Class: 0
DateTime: 0 DateTime: 0
HTML::Entities: 0
Locale::Maketext: 1.09 Locale::Maketext: 1.09
Moose: 0.59 Moose: 0.59
MooseX::AttributeHelpers: 0.14 MooseX::AttributeHelpers: 0.14
UNIVERSAL::require: 0 UNIVERSAL::require: 0
perl: 5.8.0 perl: 5.8.0
resources: resources:
license: http://dev.perl.org/licenses/ license: http://dev.perl.org/licenses/
version: 0.09 version: 0.10
1 change: 1 addition & 0 deletions Makefile.PL
Expand Up @@ -14,6 +14,7 @@ requires 'UNIVERSAL::require' => '0';
requires 'Locale::Maketext' => '1.09'; requires 'Locale::Maketext' => '1.09';
requires 'DateTime'; requires 'DateTime';
requires 'DBIx::Class'; requires 'DBIx::Class';
requires 'HTML::Entities';


recommends 'Catalyst'; recommends 'Catalyst';
recommends 'Catalyst::Component::InstancePerContext'; recommends 'Catalyst::Component::InstancePerContext';
Expand Down
6 changes: 3 additions & 3 deletions lib/HTML/FormHandler.pm
Expand Up @@ -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 =head2 field_list
Expand Down Expand Up @@ -262,7 +262,7 @@ will return the form name + "." + field name
=cut =cut


has 'html_prefix' => ( isa => 'Bool', is => 'rw', default => 0 ); has 'html_prefix' => ( isa => 'Bool', is => 'rw' );


=head2 init_object =head2 init_object
Expand Down Expand Up @@ -719,7 +719,7 @@ field objects. It calls the make_field() method for each field.
sub build_form sub build_form
{ {
my $self = shift; my $self = shift;
$DB::single=1;
my $meta_flist = $self->meta->field_list if $self->meta->can('field_list'); my $meta_flist = $self->meta->field_list if $self->meta->can('field_list');
my $flist = $self->field_list; my $flist = $self->field_list;
$self->_build_fields( $meta_flist, 0 ) if $meta_flist; $self->_build_fields( $meta_flist, 0 ) if $meta_flist;
Expand Down
10 changes: 10 additions & 0 deletions lib/HTML/FormHandler/Manual/Cookbook.pod
Expand Up @@ -129,6 +129,16 @@ Or you can make these customizations Moose roles.
with 'MyApp::Form::Role::Base'; 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 =head1 AUTHOR


Expand Down
2 changes: 1 addition & 1 deletion lib/HTML/FormHandler/Moose.pm
Expand Up @@ -38,7 +38,7 @@ sub init_meta {
sub has_field sub has_field
{ {
my ( $class, $name, %options ) = @_; my ( $class, $name, %options ) = @_;
$DB::single=1;
my $value = $class->meta->field_list || []; my $value = $class->meta->field_list || [];
if( scalar @{$value} == 0 ) if( scalar @{$value} == 0 )
{ {
Expand Down

0 comments on commit 03a211c

Please sign in to comment.