[Catalyst] Invoke *complete* subrequests in Catalyst?
Jonathan Rockway
jon at jrock.us
Tue Sep 19 21:39:04 CEST 2006
You might want to rethink using a plugin and instead just create a
custom controller that does what you want. This has the advantage of
not employing any trickery, so it's easy to figure out what's going on.
I prefer code that does what it says, rather than some magic that
gets mysteriously called during prepare()/finalize(). As mst indirectly
mentions, this can be prone to bugs, whereas your own controller (that
you can call from /begin or /auto and /end anyway) won't fall victim to
the unintended side effects here (i.e. calling prepare/finalize in other
plugins).
Your own controller is also easier to debug than the interaction between
a plugin, NEXT, and the Catalyst core :)
That said, how about the Larry Wall way:
my $me my $page
Hopefully you're using myapp_server -f or the POE engine :/
:)
Regards,
Jonathan Rockway
Nate Wiger wrote:
> Is there a way to invoke a complete subrequest, with a complete request
> cycle, in Catalyst? I've tried the Plugin::SubRequest and it's a step in
> the right direction, but what I need is something that allows complete
> prepare()/finalize() functionality.
>
> I'm building an AJAX app with FormBuilder, and want to use it to embed
> multiple forms in a page (each of which would be linked to a different
> action and submitted using JQuery). I've found I can do this, but I've
> had to make changes to the FB plugin so that it only instantiates an
> object on a call to $c->form, and doesn't use prepare() to do so. This
> then requires a bit of internal magic to work both normally and in
> subrequest mode.
>
> Other ideas?
>
> -Nate
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 368 bytes
Desc: OpenPGP digital signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060919/9a513cde/attachment.pgp
More information about the Catalyst
mailing list