Commit | Line | Data |
a6c13ff4 |
1 | package Catalyst::IOC::SubContainer; |
59aacfa7 |
2 | use Bread::Board; |
3 | use Moose; |
a6c13ff4 |
4 | use Catalyst::IOC::BlockInjection; |
59aacfa7 |
5 | |
6 | extends 'Bread::Board::Container'; |
7 | |
8 | sub get_component { |
77e27f6e |
9 | my ( $self, $name, @args ) = @_; |
4f38bf4b |
10 | |
11 | return $self->resolve( |
12 | service => $name, |
77e27f6e |
13 | parameters => { accept_context_args => \@args }, |
4f38bf4b |
14 | ); |
59aacfa7 |
15 | } |
16 | |
1f90ca59 |
17 | sub get_component_regexp { |
5a53ef3d |
18 | my ( $self, $query, $c, @args ) = @_; |
1f90ca59 |
19 | |
1f90ca59 |
20 | my @result = map { |
77e27f6e |
21 | $self->get_component( $_, $c, @args ) |
ff974a7c |
22 | } grep { m/$query/ } $self->get_service_list; |
1f90ca59 |
23 | |
1f90ca59 |
24 | return @result; |
25 | } |
26 | |
59aacfa7 |
27 | 1; |
4f38bf4b |
28 | |
29 | __END__ |
30 | |
31 | =pod |
32 | |
33 | =head1 NAME |
34 | |
a6c13ff4 |
35 | Catalyst::IOC::SubContainer - Container for models, controllers and views |
4f38bf4b |
36 | |
37 | =head1 METHODS |
38 | |
39 | =head2 get_component |
40 | |
41 | =head2 get_component_regexp |
42 | |
43 | =head1 AUTHORS |
44 | |
45 | Catalyst Contributors, see Catalyst.pm |
46 | |
47 | =head1 COPYRIGHT |
48 | |
49 | This library is free software. You can redistribute it and/or modify it under |
50 | the same terms as Perl itself. |
51 | |
52 | =cut |