定制 indragunawan/facade-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

indragunawan/facade-bundle

最新稳定版本:v0.2.0

Composer 安装命令:

composer require indragunawan/facade-bundle

包简介

Support Facades for Symfony services.

README 文档

README

license Travis Scrutinizer Coverage Scrutinizer Source Packagist

Support Facades for Symfony service.

thanks to:

  • Service Locator - for making all the referenced facade service lazy-loaded.
  • Service Autoconfiguration - for making all classes that extend Indragunawan\FacadeBundle\AbstractFacade class automatically tagged as facade.

Documentation

Installation

If your project already uses Symfony Flex, execute this command to download, register and configure the bundle automatically:

composer require indragunawan/facade-bundle

If you install without using Symfony Flex, first add the bundle by using composer then enable the bundle by adding new Indragunawan\FacadeBundle\IndragunawanFacadeBundle() to the list of registered bundles in the app/AppKernel.php file of your project

Creating Facade

To create a facade create a class that extends base Indragunawan\FacadeBundle\AbstractFacade class and implement the getFacadeAccessor method that returns the service id, support private and public service.

<?php

namespace App\Facades;

use Indragunawan\FacadeBundle\AbstractFacade;

class Foo extends AbstractFacade
{
    protected static function getFacadeAccessor()
    {
        return 'App\Service\Foo'; // service id - supports private and public service.
    }
}

Now the facade now ready. Simply import the facade namespace. When you call any static method on the Foo facade, then it will resolve the service that you define in getFacadeAccessor method and call the requested method from the service.

License

This bundle is under the MIT license. See the complete license

统计信息

  • 总下载量: 12.78k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 17
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-01-16