}
# Add our self to components, since we are also a component
- $class->components->{$class} = $class->setup_component($class);
+ if( $class->isa('Catalyst::Controller') ){
+ $class->components->{$class} = $class;
+ }
$class->setup_actions;
#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
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};
sub config { {} };
}
-is(MyApp::Controller::Foo->COMPONENT('MyApp')->action_namespace('Stub'), 'foo');
+is(MyApp::Controller::Foo->action_namespace('Stub'), 'foo');
-is(MyApp::Controller::Root->COMPONENT('MyApp')->action_namespace('Stub'), '');
+is(MyApp::Controller::Root->action_namespace('Stub'), '');
use_ok('TestApp');
-is(TestApp->component('TestApp')->action_for('global_action')->code, TestApp->can('global_action'),
+is(TestApp->action_for('global_action')->code, TestApp->can('global_action'),
'action_for on appclass ok');
is(TestApp->controller('Args')->action_for('args')->code,