phpfox/container
最新稳定版本:0.3.0
Composer 安装命令:
composer require phpfox/container
包简介
A simple DI container for the PHPFox framework
README 文档
README
This is the repository for the DI Container used in the PHP-Fox framework.
Installation
You should not need to install this package when using the PHP-Fox framework, however if you wish to use this outside of the framework please use:
composer require phpfox/container
Usage
To use the container, all you need to do is:
$container = Container::getInstance(); $container->bind( abstract: Abstract::class, concrete: Concrete::class, shared: false, // defaults to false - true turns this into a singleton. ); /** * @var bool */ $exists = $container->has( id: Abstract::class, ); /** * @var Concrete */ $concrete = $container->make( abstract: Abstract::class, );
Container implementation inspired by example repo from Jess Archer, which provides a great and simple base.
统计信息
- 总下载量: 11.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-17