unless ($result) {
- my $comp;
+ my $class = ref($command) || ref($c->component($command));
+ my $method = shift || 'process';
- unless ( $comp = (ref $command ? $command : $c->component($command)) ) {
+ unless ( $class ) {
my $error =
qq/Couldn't forward to command "$command". Invalid action or component./;
$c->error($error);
return 0;
}
- my $class = ref $comp;
- my $method = shift || 'process';
-
if ( my $code = $class->can($method) ) {
my $action = $self->method_action_class->new(
{
sub three : Local {
my ( $self, $c ) = @_;
- $c->forward('four');
+ $c->forward($self, 'four');
}
sub four : Private {
sub jojo : Local {
my ( $self, $c ) = @_;
$c->forward('one');
- $c->forward('three');
+ $c->forward($c->controller('Action::Forward'), 'three');
}
sub inheritance : Local {