https://github.com/mayocream/simple-di
A Simple PHP DI (Service Container).
https://github.com/mayocream/simple-di
Last synced: 7 months ago
JSON representation
A Simple PHP DI (Service Container).
- Host: GitHub
- URL: https://github.com/mayocream/simple-di
- Owner: mayocream
- Created: 2018-01-29T06:26:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-29T06:34:13.000Z (over 8 years ago)
- Last Synced: 2025-02-15T11:37:29.733Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple-DI
## Usage
```php
include "DI.php";
$app = Di::instance();
共享 Share
$app->set('db', function() {
return new Medoo\Medoo;
});
单例 Singleton
$app->new('md', function() {
// ...
});
获取服务
$app->get('db');
$app->get('md');
```