=item *
-C<case_sensitive> - Makes private paths case sensitive. See L</CASE SENSITIVITY>.
-
-=item *
-
C<default_model> - The default model picked if you say C<< $c->model >>. See L</$c->model($name)>.
=item *
=head1 CASE SENSITIVITY
-By default Catalyst is not case sensitive, so C<MyApp::C::FOO::Bar> is
-mapped to C</foo/bar>. You can activate case sensitivity with a config
-parameter.
-
- MyApp->config(case_sensitive => 1);
-
-This causes C<MyApp::C::Foo::Bar> to map to C</Foo/Bar>.
+Catalyst is not case sensitive, so C<MyApp::C::FOO::Bar> is
+mapped to C</foo/bar>.
=head1 ON-DEMAND PARSER
models
views
component
- around config
+ config
log
debug
dispatcher
prepare
engine_class
setup_actions
- case_sensitive
search_extra
root
parse_on_demand
my ( $self, $c ) = @_;
my $class = ref($self) || $self;
- my $appclass = ref($c) || $c;
if( ref($self) ){
return $self->$orig if $self->has_action_namespace;
} else {
return $class->config->{namespace} if exists $class->config->{namespace};
}
- my $case_s;
- if( $c ){
- $case_s = $c->config->{case_sensitive};
- } else {
- if ($self->isa('Catalyst')) {
- $case_s = $class->config->{case_sensitive};
- } else {
- if (ref $self) {
- $case_s = ref($self->_application)->config->{case_sensitive};
- } else {
- confess("Can't figure out case_sensitive setting");
- }
- }
- }
-
- my $namespace = Catalyst::Utils::class2prefix($self->catalyst_component_name, $case_s) || '';
+ my $namespace = Catalyst::Utils::class2prefix($self->catalyst_component_name) || '';
$self->$orig($namespace) if ref($self);
return $namespace;
};
reverse => "$component_or_class->$method",
class => $component_or_class,
namespace => Catalyst::Utils::class2prefix(
- $component_or_class, $c->config->{case_sensitive}
+ $component_or_class,
),
}
);
reverse => "$component_class->$method",
class => $component_class,
namespace => Catalyst::Utils::class2prefix(
- $component_class, $c->config->{case_sensitive}
+ $component_class,
),
}
);
return uc($class);
}
-=head2 class2prefix( $class, $case );
+=head2 class2prefix( $class );
-Returns the uri prefix for a class. If case is false the prefix is converted to lowercase.
+Returns the uri prefix for a class. The prefix is converted to lowercase.
My::App::Controller::Foo::Bar becomes foo/bar
sub class2prefix {
my $class = shift || '';
- my $case = shift || 0;
my $prefix;
if ( $class =~ /^.+?::([MVC]|Model|View|Controller)::(.+)$/ ) {
- $prefix = $case ? $2 : lc $2;
+ $prefix = lc $2;
$prefix =~ s{::}{/}g;
}
return $prefix;