my ($type, $name) = _get_component_type_name($component);
-# FIXME: shouldn't the service name be $name?
$containers->{$type}->add_service(Catalyst::IOC::BlockInjection->new( name => $name, block => sub { return $class->setup_component($component) } ));
}
$class->components->{ $component } = $class->setup_component($component);
}
}
+
+ $containers->{model}->make_single_default;
+ $containers->{view}->make_single_default;
}
sub _get_component_type_name {
return @result;
}
+# FIXME: not the best name for a sub
+sub make_single_default {
+ my ( $self ) = @_;
+
+ my @complist = $self->get_service_list;
+
+ $self->default_component( shift @complist )
+ if !$self->default_component && scalar @complist == 1;
+}
+
1;
__END__
=head2 get_component_regexp
+=head2 make_single_default
+
=head1 AUTHORS
Catalyst Contributors, see Catalyst.pm