1 package Catalyst::IOC::ConstructorInjection;
3 extends 'Bread::Board::ConstructorInjection';
5 with 'Bread::Board::Service::WithClass',
6 'Bread::Board::Service::WithDependencies',
7 'Bread::Board::Service::WithParameters',
8 'Catalyst::IOC::Service::WithCOMPONENT';
10 # FIXME - how much of this should move to ::WithCOMPONENT?
14 my $constructor = $self->constructor_name;
15 my $component = $self->class;
16 my $params = $self->params;
17 my $config = $params->{config}->{ $self->param('suffix') } || {};
18 my $app_name = $params->{application_name};
20 # Stash catalyst_component_name in the config here, so that custom COMPONENT
21 # methods also pass it. local to avoid pointlessly shitting in config
22 # for the debug screen, as $component is already the key name.
23 local $config->{catalyst_component_name} = $component;
25 return $component->$constructor( $app_name, $config );
28 __PACKAGE__->meta->make_immutable;
38 Catalyst::IOC::ConstructorInjection
46 Catalyst Contributors, see Catalyst.pm
50 This library is free software. You can redistribute it and/or modify it under
51 the same terms as Perl itself.