[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/phpbb/template/twig/extension/ -> config.php (source)

   1  <?php
   2  /**
   3   *
   4   * This file is part of the phpBB Forum Software package.
   5   *
   6   * @copyright (c) phpBB Limited <https://www.phpbb.com>
   7   * @license GNU General Public License, version 2 (GPL-2.0)
   8   *
   9   * For full copyright and license information, please see
  10   * the docs/CREDITS.txt file.
  11   *
  12   */
  13  
  14  namespace phpbb\template\twig\extension;
  15  
  16  class config extends \Twig_Extension
  17  {
  18      /** @var \phpbb\config\config */
  19      protected $config;
  20  
  21      /**
  22       * Constructor.
  23       *
  24       * @param \phpbb\config\config    $config        Configuration object
  25       */
  26  	public function __construct(\phpbb\config\config $config)
  27      {
  28          $this->config = $config;
  29      }
  30  
  31      /**
  32       * Get the name of this extension
  33       *
  34       * @return string
  35       */
  36  	public function getName()
  37      {
  38          return 'config';
  39      }
  40  
  41      /**
  42       * Returns a list of global functions to add to the existing list.
  43       *
  44       * @return array An array of global functions
  45       */
  46  	public function getFunctions()
  47      {
  48          return array(
  49              new \Twig\TwigFunction('config', array($this, 'get_config')),
  50          );
  51      }
  52  
  53      /**
  54       * Retrieves a configuration value for use in templates.
  55       *
  56       * @return string    The configuration value
  57       */
  58  	public function get_config()
  59      {
  60          $args = func_get_args();
  61  
  62          return $this->config->offsetGet($args[0]);
  63      }
  64  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1