[Catalyst] Re: Can't detach from root / create action object
Aristotle Pagaltzis
pagaltzis at gmx.de
Thu Nov 28 10:33:36 GMT 2013
* Hartmaier Alexander <alexander.hartmaier at t-systems.at> [2013-11-27 13:30]:
> Exactly like I just told you on IRC:
> $c->detach($c->controller('ComplianceUpdate')->action_for('index'));
Or using an action path:
$c->detach( $c->dispatcher->get_action_by_path('/complianceupdate/index') );
It’s a mouthful so if you need it lots, stick a method in your
application class à la
sub path_action {
my $c = shift;
$c->dispatcher->get_action_by_path( @_ );
}
so you can then say
$c->detach( $c->path_action('/complianceupdate/index') );
Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
More information about the Catalyst
mailing list