Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IoC Container #1257

Open
shopblocks opened this issue Jan 8, 2016 · 5 comments
Open

IoC Container #1257

shopblocks opened this issue Jan 8, 2016 · 5 comments

Comments

@shopblocks
Copy link

Since dependency injection can be done via $_classes, this is helpful in methods for doing static::_instance('ClassName') to get an instance of the class you want, so that tests can override certain methods.

An IoC Container would be a welcome addition, so that Instances can be instantiated in the parameter list rather than doing the call to _instance() ourselves.

Is this something that would be considered for the roadmap?

@fedeisas
Copy link

We're using Pimple in our li3 app and I've found really hard to inject controllers. It would be great if li3 had bindings to implement whatever IoC container you want.

@fedeisas
Copy link

Also, the documentation for the current implementation is sparse: http://li3.me/docs/manual/architecture/dependencies.md

@mariuswilms
Copy link
Member

@fedeisas Yes it's sparse, as sparse can get. Please open a ticket over at https://github.com/UnionOfRAD/manual so we have something to track it. Needless to say that we'd be glad for help expanding it ;)

@fedeisas
Copy link

Hi @DavidPersson! I'd gladly write it, but I have to say I don't understand how this injection is supposed to work.

The $_classes and $_autoConfig variables of lithium\core\Object are really confusing to me. But hey, maybe it's just me.

Anyway, it would be great to have working examples on how to use those features.

@mariuswilms
Copy link
Member

I can shed some light on it :)

@mariuswilms mariuswilms changed the title [Feature Request] IoC Container IoC Container Feb 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants