2017 © Pedro Peláez
 

symfony-bundle facade-bundle

Support Facades for Symfony service.

image

indragunawan/facade-bundle

Support Facades for Symfony service.

  • Tuesday, January 16, 2018
  • by indragunawan
  • Repository
  • 2 Watchers
  • 7 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 500 % Grown

The README.md

FacadeBundle

license Travis Scrutinizer Coverage Scrutinizer Source Packagist, (*1)

Support Facades for Symfony service., (*2)

thanks to:, (*3)

  • 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:, (*4)

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, (*5)

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., (*6)

<?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., (*7)

License

This bundle is under the MIT license. See the complete license, (*8)

The Versions

16/01 2018

dev-master

9999999-dev

Support Facades for Symfony service.

  Sources   Download

MIT

The Requires

 

The Development Requires

16/01 2018

v0.1.0

0.1.0.0

Support Facades for Symfony service.

  Sources   Download

MIT

The Requires

 

The Development Requires