plugins; was Re: [Catalyst] debug mode

Michael Reece mreece at vinq.com
Tue Jun 5 21:42:42 GMT 2007


On Jun 5, 2007, at 12:33 PM, Matt S Trout wrote:

> On Tue, Jun 05, 2007 at 08:04:03AM -0700, mreece at vinq.com wrote:
>> if the catalyst base controller class provided an easy way to  
>> access $c
>> from a utility method (vs an action method, which receives $c
>> 'automatically'), then i think plugins might be a little less  
>> popular.
>
> Well, you can already do $self->_app to get the application.

but that holds only the class, right?  ie, "MyApp"


>>   sub _ACTION : Pricvate {
>>     my ($self, $c) = @_;
>>     $self->_context($c);
>>     $self->SUPER::_ACTION($c);
>>   }
>
> That's not only in the wrong place to work for begin/end/auto it  
> screws up
> the destruction process and is therefore really really dangerous.

i had a feeling it was less than ideal, which is why i threw it out  
there.  can you clarify what you mean about the destruction process?   
i don't see anything special in ACCEPT_CONTEXT.pm to deal with that..

>
> http://search.cpan.org/~jrockway/Catalyst-Component- 
> ACCEPT_CONTEXT-0.02/lib/Catalyst/Component/ACCEPT_CONTEXT.pm
>
> is an already extant, non-buggy version.
>
> Don't Reinvent The Wheel :)

but but!  my (buggy) code pre-dates this CPAN wheel by about 4 months ;)

i'll try swapping this in and see how it goes, thanks!

michael.




More information about the Catalyst mailing list