Daisuke Maki > Orochi-0.00010 > Orochi::Declare

Download:
Orochi-0.00010.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  2
Open  0
View/Report Bugs
Source  

NAME ^

Orochi::Declare - Declarative Style Orochi DI

SYNOPSIS ^

    use Orochi::Declare;

    my $c = container {
        inject_constructor '/myapp' => (
            class => 'MyApp',
            args  => {
                foo => bind_value '/myapp/foo',
            }
        );
        inject_constructor '/myapp/foo' => (
            class => 'MyApp::Foo',
            args  => {
                bar => bind_value '/myapp/foo/bar'
            }
        );
        inject_literal '/myapp/foo/bar' => 1;
    }

    my $myapp = $c->get('/myapp');
syntax highlighting: