yottacms/yotta-unit-bundle
Composer 安装命令:
composer require yottacms/yotta-unit-bundle
包简介
Yotta unit manager bundle
README 文档
README
Пакетный менеджер бандлов для YottaCMS
Installation
composer require yottacms/yotta-unit-bundle
Usage
# app/config/services.yml \UnitExample: arguments: ['@service_container'] tags: - { name: yotta.unit, priority: 300 }
Recommendations
Настройку юнит-сервиса лучше всего делать следующим образом:
# app/config/config.yml yotta_unit: items: unit_example: type: "bundle" # widget | system name: "Unit Info" description: "Unit information" icon: "info" # optional version: "0.0.1" # optional # if bundle | widget entry_point: "/info" # path to entry point developer: true # set true to developer's bundle
// UnitExample.php use Symfony\Component\DependencyInjection\ContainerInterface; use YottaCms\Bundle\YottaUnitBundle\UnitManager\UnitInterface; class UnitExample implements UnitInterface { const PARAMETER_KEY = 'unit_example'; protected $configUnit; public function __construct(ContainerInterface $container) { if (!isset($container->getParameter('yotta_unit.items')[self::PARAMETER_KEY])) { throw new \Exception('Parameters "' . self::PARAMETER_KEY . '" not found in yotta_unit.items'); } $this->configUnit = $container->getParameter('yotta_unit.items')[self::PARAMETER_KEY]; } /** * @inheritdoc */ public function getName(): string { return $this->configUnit['name']; } /** * @inheritdoc */ public function getDescription(): ?string { return $this->configUnit['description']; } /** * @inheritdoc */ public function getEntryPoint(): ?string { return $this->configUnit['entry_point']; } /** * @inheritdoc */ public function getConfig(): array { return $this->configUnit; } /** * @inheritdoc */ public function getType(): string { return $this->configUnit['type']; } }
统计信息
- 总下载量: 60
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-03