1 package Catalyst::IOC::SubContainer;
4 use Catalyst::IOC::BlockInjection;
6 extends 'Bread::Board::Container';
8 has default_component => (
12 writer => '_set_default_component',
16 my ( $self, $name, @args ) = @_;
18 return $self->resolve(
20 parameters => { accept_context_args => \@args },
24 sub get_component_regexp {
25 my ( $self, $query, $c, @args ) = @_;
28 $self->get_component( $_, $c, @args )
29 } grep { m/$query/ } $self->get_service_list;
34 # FIXME: not the best name for a sub
35 sub make_single_default {
38 my @complist = $self->get_service_list;
40 $self->_set_default_component( shift @complist )
41 if !$self->default_component && scalar @complist == 1;
52 Catalyst::IOC::SubContainer - Container for models, controllers and views
58 =head2 get_component_regexp
60 =head2 make_single_default
64 Catalyst Contributors, see Catalyst.pm
68 This library is free software. You can redistribute it and/or modify it under
69 the same terms as Perl itself.