Download the PHP package kopikode/container without Composer
On this page you can find all versions of the php package kopikode/container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kopikode/container
More information about kopikode/container
Files in kopikode/container
Download kopikode/container
More information about kopikode/container
Files in kopikode/container
Vendor kopikode
Package container
Short Description An array container for simplification usability
License MIT
Package container
Short Description An array container for simplification usability
License MIT
Please rate this library. Is it a good library?
Informations about the package container
KopiKode Container
A PHP array container for simplification usability
Requirement
You need PHP >= 5.3.0.
Installation
Add requirements to your composer json files
"require": {
"kopikode/container": "dev-master"
}
Manual
PHP Native array access
// Set
$arr = array();
$arr['user']['administrator'] = 'Somy A';
// Get
$admin = $arr['user']['administrator];
Container Access
// Initiate
$container = new \KopiKode\Container;
// Set
$container['user.administrator] = 'Somy A';
// Get
$admin = $container['user.administrator'];
Nested Access (get upper level )
$users = $container['user'];
will reproduce
array (
'administrator' => 'Somy A'
)
Service / Callable Dependency Injection ( added on v.1.1.0 )
With Service Dependency Injection, you can store callable which return same Instance of callable. Default parameters always container it self
$container = new \KopiKode\Container;
$container['session'] = function ($c) {
return new SomeSessionServices();
};
$container['session']->sessionMethod();
All versions of container with dependencies
PHP Build Version
Package Version
The package kopikode/container contains the following files
Loading the files please wait ....