jameshalsall/squeezed 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jameshalsall/squeezed

最新稳定版本:1.0.1

Composer 安装命令:

composer require jameshalsall/squeezed

包简介

An extension of the simple service container Pimple to provide tagging support.

README 文档

README

An extension of the simple service container Pimple to provide tagging support.

Using Squeezed

Tagging a service

You can tag a service in the container by using the Squeezed::tagService(); method:

$container = new Squeezed();
$container['some_service'] = new SomeService();
$container['another_service'] = new AnotherService();

$container->tagService('tag name', 'some_service');
$container->tagService('tag name', 'another_service');

Retrieving services by tag

Once you have tagged some services you can then retrieve them by their tag name. This is useful when dealing with categories of services such as console commands or controllers.

$taggedServices = $container->getByTag('tag name');

This will return an array of the tagged services indexed by their service ID.

Future Development

  • Add support for Pimple 2.0

统计信息

  • 总下载量: 382
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-02-04