use Class::Inspector;
use NEXT;
-__PACKAGE__->mk_classdata($_) for qw/_dispatch_steps/;
+__PACKAGE__->mk_classdata($_) for qw/_dispatch_steps _action_class/;
__PACKAGE__->_dispatch_steps( [qw/_BEGIN _AUTO _ACTION/] );
+__PACKAGE__->_action_class('Catalyst::Action');
sub _DISPATCH : Private {
my ( $self, $c ) = @_;
next;
}
my $reverse = $namespace ? "$namespace/$method" : $method;
- my $action = Catalyst::Action->new(
+ my $action = $self->_action_class->new(
{
name => $method,
code => $code,
# Stringify to class
use overload '""' => sub { return ref shift }, fallback => 1;
-__PACKAGE__->mk_accessors(qw/tree dispatch_types registered_dispatch_types/);
+__PACKAGE__->mk_accessors(qw/tree dispatch_types registered_dispatch_types
+ method_action_class action_container_class/);
# Preload these action types
our @PRELOAD = qw/Path Regex/;
my $method = shift || 'process';
if ( my $code = $class->can($method) ) {
- my $action = Catalyst::Action->new(
+ my $action = $self->method_action_class->new(
{
name => $method,
code => $code,
$self->dispatch_types( [] );
$self->registered_dispatch_types( {} );
+ $self->method_action_class( 'Catalyst::Action' );
+ $self->action_container_class( 'Catalyst::ActionContainer' );
# Preload action types
for my $type (@PRELOAD) {