package Catalyst::Controller;
#switch to BEGIN { extends qw/ ... /; } ?
-use MRO::Compat;
-use mro 'c3';
use base qw/Catalyst::Component Catalyst::AttrContainer/;
use Moose;
return !@{ $c->error };
}
-sub new {
+around new => sub {
+ my $orig = shift;
my $self = shift;
my $app = $_[0];
- my $new = $self->next::method(@_);
+ my $new = $self->$orig(@_);
$new->_application( $app );
return $new;
-}
+};
sub action_for {
my ( $self, $name ) = @_;
#my opinion is that this whole sub really should be a builder method, not
#something that happens on every call. Anyone else disagree?? -- groditi
-
-#we are wrapping the accessor, so just uyse a modifier since a normal sub would
-#just be overridden by the generated moose method
+## -- apparently this is all just waiting for app/ctx split
around action_namespace => sub {
my $orig = shift;
my ( $self, $c ) = @_;
if( ref($self) ){
return $self->$orig if $self->has_action_namespace;
- } else {
- warn "action_namespace called as class method";
- # if the following won't change at runtime it should be lazy_building thing
+ } else {
return $self->config->{namespace} if exists $self->config->{namespace};
}
- #the following looks like a possible target for a default setting. i am not
- #making the below the builder because i don't know if $c will vary from
- #call to call, which would affect case sensitivity settings -- groditi
my $case_s;
if( $c ){
$case_s = $c->config->{case_sensitive};