1 package Catalyst::IOC::SubContainer;
4 use Catalyst::IOC::BlockInjection;
6 extends 'Bread::Board::Container';
8 has default_component => (
15 my ( $self, $name, @args ) = @_;
17 return $self->resolve(
19 parameters => { accept_context_args => \@args },
23 sub get_component_regexp {
24 my ( $self, $query, $c, @args ) = @_;
27 $self->get_component( $_, $c, @args )
28 } grep { m/$query/ } $self->get_service_list;
33 # FIXME: not the best name for a sub
34 sub make_single_default {
37 my @complist = $self->get_service_list;
39 $self->default_component( shift @complist )
40 if !$self->default_component && scalar @complist == 1;
51 Catalyst::IOC::SubContainer - Container for models, controllers and views
57 =head2 get_component_regexp
59 =head2 make_single_default
63 Catalyst Contributors, see Catalyst.pm
67 This library is free software. You can redistribute it and/or modify it under
68 the same terms as Perl itself.