[Catalyst] Subrequests and Plugins that use finalize
Bill Moseley
moseley at hank.org
Wed Dec 21 03:07:59 CET 2005
I was using a subrequest to generate a form and noticed that the form
was not pre-filled. That happened because finalize isn't called
during a sub-request -- which makes sense. But, that's where
FillInForm does its work.
If you did a subrequest for an action that generates a form would you
expect it to be filled in by FillInForm?
Granted, a subrequest for a form may not be very common, but it makes
me wonder if there should be a way for plugins to work on subrequest data
in a finalize-type of method.
Perhaps have finalize be an empty hook for plugins and the current
finalize gets renamed to finalize_request. Then SubRequest could call
finalize.
So handle_request does something like:
my $handler = sub {
my $c = $class->prepare(@arguments);
$c->{stats} = \@stats;
$c->dispatch;
$c->finalize;
return $c->finalize_request;
};
I wonder how much that would break.
--
Bill Moseley
moseley at hank.org
More information about the Catalyst
mailing list