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',
9 'Catalyst::IOC::Service::WithAcceptContext';
11 # FIXME - how much of this should move to ::WithCOMPONENT?
15 my $constructor = $self->constructor_name;
16 my $component = $self->class;
17 my $params = $self->params;
18 my $config = $params->{config}->{ $self->param('suffix') } || {};
19 my $app_name = $params->{application_name};
21 # Stash catalyst_component_name in the config here, so that custom COMPONENT
22 # methods also pass it. local to avoid pointlessly shitting in config
23 # for the debug screen, as $component is already the key name.
24 local $config->{catalyst_component_name} = $component;
26 return $component->$constructor( $app_name, $config );
29 __PACKAGE__->meta->make_immutable;
39 Catalyst::IOC::ConstructorInjection
47 Catalyst Contributors, see Catalyst.pm
51 This library is free software. You can redistribute it and/or modify it under
52 the same terms as Perl itself.