Skip to content

Autowiring class method/passed closure? #13

@oakleaf

Description

@oakleaf

Hello, Im experimenting with Zen (among other libraries) for finding the perfect DI for my framework. I really can't get my head around how to create the autowiring functionality for a specific method of my "kernel" class.

E.g.

class Kernel{
public function init(\Closure $_callback)
{
return $_callback(); // I want this CB to have autowired classes available
}
}

// Index.php
(new Kernel())->init(function(Request $request){

I have figured out to use EntryPoints in my configuration in order to register which classes that should be autowired, but I can't figure out how to put that into classes & methods like Im trying to explain above. Is it even possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions