Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
So funktioniert es
|
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
config.php
01 <?php
02 /**
03 *
04 * This file is part of the phpBB Forum Software package.
05 *
06 * @copyright (c) phpBB Limited <https://www.phpbb.com>
07 * @license GNU General Public License, version 2 (GPL-2.0)
08 *
09 * 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 }
65