[Catalyst] Plugin methods and context namespace
John Wang
johncwang at gmail.com
Fri Nov 25 02:33:20 CET 2005
On 11/24/05, Christopher H. Laco <claco at chrislaco.com> wrote:
>
> Sebastian Riedel wrote:
> >
> > Am 25.11.2005 um 01:40 schrieb Christopher H. Laco:
> >
> >> I'm assuming that without specifying a name space above, it would've
> >> been $c->define_javascript_functions?
> >
> > No.
>
> then what's the first arg for?
I assume:
MyApp->plugin( 'prototype', 'HTML::Prototype' );
is similar to following in Catalyst::Plugin::Prototype:
__PACKAGE__->mk_classdata('prototype');
__PACKAGE__->prototype( HTML::Prototype->new );
It allows you to assign an object instance to the $c namespace. The
define_javascript_functions method is part of the HTML::Prototype object,
not the Catalyst::Plugin::Prototype itself. Methods directly in the plugin
as sub foo {} get assigned as $c->foo.
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20051124/054e3fa4/attachment.htm
More information about the Catalyst
mailing list