CGI::Application::Plugin::FillInForm

markjugg on 2005-07-29T03:57:47

I uploaded the first release of CGI::Application::Plugin::FillInForm tonight.

It just makes a nice, simple, Do-What-I-Mean wrapper around HTML::FillInForm, inspired by some code by Cees Hek. Here's what it looks like in action:

 
    # fill an HTML form with data in a hashref or from an object with with a param() method
    my $filled_html = $self->fill_form($html,$data);

# ..or default to getting data from $self->query() my $filled_html = $self->fill_form($html);

However, I'm too lazy to write some tests for it tonight, so I marked it as a developer release for now.

This plugin is yet another way the CGI::Application framework can streamline development.

So we should be ready to announce a totally re-vamped website with updated information.


Cuts a line off my postprocessing

Phred on 2005-07-29T08:03:22

I currently use CGI::Application::Plugin::TT, a custom session handler, and HTML::FillInForm as a way of making sticky forms which are populated with any of the user's current session data. Use of this module will eliminate the call to HTML::FillInForm->new from my postprocessing routine. Thanks Mark!

sub tt_post_process {

    my ($self, $htmlref) = @_;

    $$htmlref = $self->fill_form($$htmlref, $self->session->param_hashref());

    return;
}