[Catalyst] Question about $c->forward()
Sebastian Riedel
sri at oook.de
Thu Nov 10 10:47:27 CET 2005
Am 10.11.2005 um 10:37 schrieb Marcello:
> Will Hawes ha scritto:
>> package My::C::First;
>> use base 'Catalyst::Base';
>> sub begin : Private {
>> ...
>> $c->forward('My::C::Second');
>> }
>> package My::C::Second;
>> use base 'Catalyst::Base';
>> sub default : Private {
>> my ( $self, $c ) = @_;
>> $c->forward('second');
>> }
>> sub second : Local {
>> die 'ok';
>> }
>> In the above example, My::C::Second::second used to get called
>> before upgrading to 5.49_02, now it doesn't. Catalyst now tries to
>> forward to My::C::First::second, doesn't find it and dies with:
>> Caught exception "My::C::Second did not override
>> Catalyst::Component::process at C:/Perl/site/lib/Catalyst/
>> Action.pm line 45"
>
> From my experience with Catalyst 5.23 and 5.33 this is the expected
> behaviour.
> That is, if you forward to a controller, that controller must
> define its own "process" method. What would $c->forward
> ('My::C::Second'); mean otherwise (i.e. what method of the package
> My::C::Second should catalyst call) ?
Oh, right, there is a missing process() method, then this is exactly
the expected behavior.
--
sebastian
More information about the Catalyst
mailing list