life-style-coding/container-pattern
Composer 安装命令:
composer require life-style-coding/container-pattern
包简介
Small library of dependency inversion with container
README 文档
README
⚠️ Huge refacto in progresse the doc is no longer up to date so usage section is not working anymore
🏠 Homepage
Install
composer require life-style-coding/container-pattern
Usage
step 1: To use it you have to provide the use statement for the package at your index.php
use LifeStyleCoding\Container\Container;
step 2: Instanciate the container class
step 3: run the resolve method of the container into a instance variable and pass the class name as argument
step 4: run the execute method of the container and pass the instance variable and the class methods you wish to call as arguments
exemple :
$class = "\\App\\Controller\\HomeController"; $method = "index"; $container = new Container(); $instance = $container->resolve($class); $container->execute($instance, $method);
Next update
Adding a list of objects already instantiated, so as not to have to reinstate them
Handle routing with block comments
Author
👤 Nicolas Montmayeur
- Github: @niko-38500
- LinkedIn: @nicolas-montmayeur-9b7b441ab
Show your support
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-04