https://github.com/phmlabs/init
Lightweight dependency injection framework
https://github.com/phmlabs/init
Last synced: about 1 year ago
JSON representation
Lightweight dependency injection framework
- Host: GitHub
- URL: https://github.com/phmlabs/init
- Owner: phmLabs
- Created: 2015-05-27T06:10:32.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-12-30T09:36:57.000Z (over 5 years ago)
- Last Synced: 2025-03-22T00:44:15.020Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- 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);
````