1 package Catalyst::IOC::SubContainer;
4 use Catalyst::IOC::BlockInjection;
6 extends 'Bread::Board::Container';
9 my ( $self, $name, $args ) = @_;
11 return $self->resolve(
13 parameters => { accept_context_args => $args },
17 sub get_component_regexp {
18 my ( $self, $c, $name, $args ) = @_;
21 if $c->config->{disable_component_resolution_regex_fallback} && !ref $name;
23 my $appclass = ref $c || $c;
24 my $prefix = ucfirst $self->name;
25 my $p = substr $prefix, 0, 1;
27 my $query = ref $name ? $name : qr{$name}i;
28 $query =~ s/^${appclass}::($p|$prefix):://i;
31 $self->get_component( $_, $args )
32 } grep { m/$query/ } $self->get_service_list;
34 if (!ref $name && $result[0]) {
35 $c->log->warn( Carp::shortmess(qq(Found results for "${name}" using regexp fallback)) );
36 $c->log->warn( 'Relying on the regexp fallback behavior for component resolution' );
37 $c->log->warn( 'is unreliable and unsafe. You have been warned' );
52 Catalyst::IOC::SubContainer - Container for models, controllers and views
58 =head2 get_component_regexp
62 Catalyst Contributors, see Catalyst.pm
66 This library is free software. You can redistribute it and/or modify it under
67 the same terms as Perl itself.