Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
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 |
SimpleFunction.php
001 <?php
002
003 /*
004 * This file is part of Twig.
005 *
006 * (c) 2010-2012 Fabien Potencier
007 *
008 * For the full copyright and license information, please view the LICENSE
009 * file that was distributed with this source code.
010 */
011
012 /**
013 * Represents a template function.
014 *
015 * @author Fabien Potencier <fabien@symfony.com>
016 */
017 class Twig_SimpleFunction
018 {
019 protected $name;
020 protected $callable;
021 protected $options;
022 protected $arguments = array();
023
024 public function __construct($name, $callable, array $options = array())
025 {
026 $this->name = $name;
027 $this->callable = $callable;
028 $this->options = array_merge(array(
029 'needs_environment' => false,
030 'needs_context' => false,
031 'is_variadic' => false,
032 'is_safe' => null,
033 'is_safe_callback' => null,
034 'node_class' => 'Twig_Node_Expression_Function',
035 'deprecated' => false,
036 'alternative' => null,
037 ), $options);
038 }
039
040 public function getName()
041 {
042 return $this->name;
043 }
044
045 public function getCallable()
046 {
047 return $this->callable;
048 }
049
050 public function getNodeClass()
051 {
052 return $this->options['node_class'];
053 }
054
055 public function setArguments($arguments)
056 {
057 $this->arguments = $arguments;
058 }
059
060 public function getArguments()
061 {
062 return $this->arguments;
063 }
064
065 public function needsEnvironment()
066 {
067 return $this->options['needs_environment'];
068 }
069
070 public function needsContext()
071 {
072 return $this->options['needs_context'];
073 }
074
075 public function getSafe(Twig_Node $functionArgs)
076 {
077 if (null !== $this->options['is_safe']) {
078 return $this->options['is_safe'];
079 }
080
081 if (null !== $this->options['is_safe_callback']) {
082 return call_user_func($this->options['is_safe_callback'], $functionArgs);
083 }
084
085 return array();
086 }
087
088 public function isVariadic()
089 {
090 return $this->options['is_variadic'];
091 }
092
093 public function isDeprecated()
094 {
095 return (bool) $this->options['deprecated'];
096 }
097
098 public function getDeprecatedVersion()
099 {
100 return $this->options['deprecated'];
101 }
102
103 public function getAlternative()
104 {
105 return $this->options['alternative'];
106 }
107 }
108