On Wed, Nov 27, 2013 at 12:36:54PM +0000, Craig Chant wrote:
No the documentation isn't clear, if I could understand it I wouldn’t be
asking this question.
I'm sorry you couldn't understand from the documentation. I'll try and explain
a little more here:
# lib/MyApp/Controller/A.pm
package MyApp::Controller::A;
...
sub my_action_1 :Local {
my ($self, $c) = @_;
$c->res->body('in action 1');
}
sub my_action_2 :Local {
my ($self, $c) = @_;
$c->detach('my_action_1');
}
# lib/MyApp/Controller/B.pm
package MyApp::Controller::A;
...
sub other_action :Local {
my ($self, $c) = @_;
$c->detach('/a/my_action_1');
# or
$c->detach('MyApp::Controller::A', 'my_action_1');
}
Is it clearer now?
Cheers!
André
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/