dsmithhayes/toychest

There is no license information available for the latest version (v1.0.2) of this package.

A basic dependency container.

v1.0.2 2016-09-25 17:00 UTC

This package is not auto-updated.

Last update: 2024-05-06 10:22:23 UTC


README

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