[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/phpbb/template/twig/ -> definition.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;
  15  
  16  /**
  17  * This class holds all DEFINE variables from the current page load
  18  */
  19  class definition
  20  {
  21      /** @var array **/
  22      protected $definitions = array();
  23  
  24      /**
  25      * Get a DEFINE'd variable
  26      *
  27      * @param string $name
  28      * @param array $arguments
  29      *
  30      * @return mixed Null if not found
  31      */
  32  	public function __call($name, $arguments)
  33      {
  34          return (isset($this->definitions[$name])) ? $this->definitions[$name] : null;
  35      }
  36  
  37      /**
  38      * DEFINE a variable
  39      *
  40      * @param string $name
  41      * @param mixed $value
  42      * @return \phpbb\template\twig\definition
  43      */
  44  	public function set($name, $value)
  45      {
  46          $this->definitions[$name] = $value;
  47  
  48          return $this;
  49      }
  50  
  51      /**
  52      * Append to a variable
  53      *
  54      * @param string $name
  55      * @param string $value
  56      * @return \phpbb\template\twig\definition
  57      */
  58  	public function append($name, $value)
  59      {
  60          if (!isset($this->definitions[$name]))
  61          {
  62              $this->definitions[$name] = '';
  63          }
  64  
  65          $this->definitions[$name] .= $value;
  66  
  67          return $this;
  68      }
  69  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1