承接 yottacms/yotta-unit-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固