You don't need rather can't use :Args(1)
for private actions in Catalyst.
From cpan Catalyst Manual:
You can pass new arguments to a forward action by adding them in an anonymous array. In the called method(or forwarded method), you would get arguments in $c->req->args
.
sub hello : Global {
my ( $self, $c ) = @_;
$c->stash->{message} = 'Hello World!';
$c->forward('check_message',[qw/test1/]);
}
sub check_message : Private {
my ( $self, $c, $first_argument ) = @_;
my $also_first_argument = $c->req->args->[0]; # now = 'test1'
# do something...
}
You can also use stash $c->stash->{typeid};
instead. Then you can directly call the method using $c->forward('priv_method');
.
Ex:
sub hello : Global {
my ( $self, $c ) = @_;
$c->stash->{message} = 'Hello World!';
$c->forward('check_message'); # $c is automatically included
}
sub check_message : Private {
my ( $self, $c ) = @_;
return unless $c->stash->{message};
$c->forward('show_message');
}
sub show_message : Private {
my ( $self, $c ) = @_;
$c->res->body( $c->stash->{message} );
}