2017 © Pedro Peláez
 

library il18_config

Cache interface for integration into third-party library

image

emerap/il18_config

Cache interface for integration into third-party library

  • Saturday, October 29, 2016
  • by karbunkul
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Basic usage

Create class and extending from \Emerap\Il18Config., (*1)

use \Emerap\Il18Config\Il18Config;

class ClassName extends Il18Config {

  /**
     * {@inheritdoc}
     */
    public static function getLibraryId() {
      return 'library_id';
    }

    /**
     * {@inheritdoc}
     */
    public static function getServicesJson() {
      return __DIR__ . '/services.yml';
    }

    /**
     * Get cache instance.
     *
     * @return Service
     *   Service instance.
     */
    public function cache() {
      return self::getService('service_id');
    }
} 

Create class implement \Emerap\Il18Config\Il18ConfigInterface and use trait \Emerap\Il18Config\Il18ConfigTrait., (*2)

use Emerap\Il18Config\Il18ConfigInterface;
use Emerap\Il18Config\Il18ConfigTrait;

class ClassName implements Il18ConfigInterface {

  use Il18ConfigTrait;

  /**
     * {@inheritdoc}
     */
    public static function getLibraryId() {
      return 'library_id';
    }

    /**
     * {@inheritdoc}
     */
    public static function getServicesJson() {
      return __DIR__ . '/services.yml';
    }

    /**
     * Get cache instance.
     *
     * @return Service
     *   Service instance.
     */
    public function cache() {
      return self::getService('service_id');
    }
} 

Copyright © 2016 [ Pokhodyun Alexander], (*3)

The Versions

29/10 2016

dev-master

9999999-dev http://emerap.com

Cache interface for integration into third-party library

  Sources   Download

GPL-3.0+

The Requires

 

config library