An open API service indexing awesome lists of open source software.

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).

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');

```