2009/2/4 abhishek jain <abhishek.netj...@gmail.com>: > friends, > how can i populate a FormFu form with a yml config file with a variable > defined on stash > so i want something like > c.stash.varhash.key > > printed in the form input text box.
To do this, I think you'd need to create a Plugin. Something like this should work... form config: elements: - name: foo plugins: DefaultFromContextStash stash_name: 'varhash.key' Then the plugin would look something like this: (completely untested, of course) package HTML::FormFu::Plugin::DefaultFromContextStash; use strict; use base 'HTML::FormFu::Plugin'; use HTML::FormFu::ObjectUtil qw( get_nested_hash_value ); __PACKAGE__->mk_item_accessors('stash_name'); sub process { my ($self) = @_; my $context = $self->stash->{context} or return; my $stash_name = $self->stash_name or return; my $value = $self->get_nested_hash_value( $context->stash, $stash_name, ); $self->parent->default( $value ); return; } 1; _______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu