Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phmlabs/init
Lightweight dependency injection framework
https://github.com/phmlabs/init
Last synced: 11 days ago
JSON representation
Lightweight dependency injection framework
- Host: GitHub
- URL: https://github.com/phmlabs/init
- Owner: phmLabs
- Created: 2015-05-27T06:10:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-30T09:36:57.000Z (almost 4 years ago)
- Last Synced: 2024-08-09T15:20:00.135Z (3 months ago)
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# phmLabs::Init
This library is a very lightweight dependency injection container. The special thing about `Init` is that it uses names parameters and fits perfectly with yaml files this way.
````php
class MyClass {
public function __construct($firstParam, $secondParam = null) {
// ...
}
}$options = [
'class' => 'MyClass',
'call' => [
'__construct' => ['secondParam' => 'foo', 'firstParam' => 'bar']
]
]$myClass = Init::initialize($options);
````