return $c->component_list;
}
- my ($type, $name) = _get_component_type_name($component);
-
- return $c->container->get_component_from_sub_container(
- $type, $name, $c, @args
- ) if $type;
-
my @result = $c->container->find_component( $component, $c, @args );
- # one last search for things like $c->comp(qr/::M::/)
- @result = $c->container->find_component_regexp(
- $c->components, $component, $c, @args
- ) if !@result and ref $component;
-
# list context for regexp searches
return @result if ref $component;
}
sub find_component {
- my ( $self, $component, @args ) = @_;
+ my ( $self, $component, $c, @args ) = @_;
+ my ( $type, $name ) = Catalyst::_get_component_type_name($component);
my @result;
+ return $self->get_component_from_sub_container(
+ $type, $name, $c, @args
+ ) if $type;
+
my $query = ref $component
? $component
: qr{^$component$}
my @components = $subcontainer->get_service_list;
@result = grep { m{$component} } @components;
- return map { $subcontainer->get_component( $_, @args ) } @result
+ return map { $subcontainer->get_component( $_, $c, @args ) } @result
if @result;
}
+ # one last search for things like $c->comp(qr/::M::/)
+ @result = $self->find_component_regexp(
+ $c->components, $component, $c, @args
+ ) if !@result and ref $component;
+
# it expects an empty list on failed searches
return @result;
}