[Catalyst] Another RFC. $c->call()

Bill Moseley moseley at hank.org
Fri Apr 14 16:33:18 CEST 2006


On Fri, Apr 14, 2006 at 03:16:48PM +0100, Matt S Trout wrote:
> >     sub edit : Local {
> >         my ( $self, $c, $id ) = @_;
> > 
> >         # display list if bad $id passed in
> >         return $c->forward2 unless $self->valid_id( $id );
> > 
> >         ...
> >     }
> 
> For that, I'd use a custom Action class that overrides $action->match to 
> return 0 if valid_id doesn't pass. Then dispatch would fall back to the 
> default automatically.

Of course, that was just an example.  Specific logic inside an action often
results in forwarding to the list action, too.

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list