[Catalyst] Updated C::P::FillInForm
Sebastian Riedel
sri at oook.de
Wed Nov 30 00:22:44 CET 2005
Am 29.11.2005 um 23:47 schrieb John Wang:
> I needed to modify C::P::FillInForm to take any parameter available
> to HTML::FillInForm's fill method since the current version of
> C::P::FillInForm only populates the 'scalarref' and 'fdat'
> parameters. Here are some changes:
>
> 1) can pass all H::FiF parameters including 'target',
> 'fill_password', 'ignore_fields', etc.
> 2) parameters can be set in the __PACKAGE__->config->{fillinform}
> {param} hashref. useful for global settings such as 'fill_password'
> 3) the config hashref can be modified with $c->fillform_set_param( \
> %fif_fill_param_hash ) for local settings such as 'target'
> 4) $c->fillform_full( \%fif_fill_param_hash ) is available for
> setting all parameters
> 5) recognizes C::P::FV::Simple so ::Simple doesn't have to inherit
> from C::P::FV
> 6) $c->fillform and $c->finalize have been modified but are
> backward compatible
>
> A copy of it is here: http://www.dev411.com/projects/
> catalyst_plugin_fillinform.txt
>
> How does it look? Is this useful? I'm not crazy about modifying the
> $c->config->{fillinform} hashref. That can be replaced with an
> accessor but I thought I'd solicit some comments first.
Yes, all parameters should be usable, but some points in your version
should be fixed.
* Remove fillform_full and make fillform accept a hashref and a list
( fillform( fdat => $c->stash->data, fill_password => 0) )
* Don't use $c->config, it's meant for static config data.
* Add tests!
--
sebastian
More information about the Catalyst
mailing list