1 package TestAppCustomContainer::SugarContainer;
3 use namespace::autoclean;
6 extends 'Catalyst::IOC::Container';
11 $self->get_sub_container('component')->add_service(
12 Catalyst::IOC::ConstructorInjection->new(
14 class => 'TestAppCustomContainer::Model::Baz',
15 # lifecycle => 'InstancePerContext',
17 depends_on( '/application_name' ),
18 depends_on( '/config' ),
19 depends_on( '/model/Foo' ),
23 $self->get_sub_container('model')->add_service(
24 Catalyst::IOC::BlockInjection->new(
27 depends_on( '/model/Foo' ),
28 depends_on( '/component/model_Baz' ),
32 my $foo = $s->param('Foo');
33 my $instance = $s->param('model_Baz');
40 __PACKAGE__->meta->make_immutable;