Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 418 Bytes

README.md

File metadata and controls

21 lines (14 loc) · 418 Bytes

ToyChest

An extremely basic dependency container.

Adding Dependencies

Adding a dependency to the container is easy. The ToyChest container implements the \ArrayAccess SPL interface so you can treat it like an array.

<?php

use ToyChest\ToyChest;
use Some\ORM\Model;

$container = new ToyChest();

$container['user'] = function ($container) {
    return new Model('User', $container['dbh']);
};