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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

SimpleFilter.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 2.52 KiB


001  <?php
002   
003  /*
004   * This file is part of Twig.
005   *
006   * (c) 2009-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 filter.
014   *
015   * @author Fabien Potencier <fabien@symfony.com>
016   */
017  class Twig_SimpleFilter
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              'pre_escape' => null,
035              'preserves_safety' => null,
036              'node_class' => 'Twig_Node_Expression_Filter',
037              'deprecated' => false,
038              'alternative' => null,
039          ), $options);
040      }
041   
042      public function getName()
043      {
044          return $this->name;
045      }
046   
047      public function getCallable()
048      {
049          return $this->callable;
050      }
051   
052      public function getNodeClass()
053      {
054          return $this->options['node_class'];
055      }
056   
057      public function setArguments($arguments)
058      {
059          $this->arguments = $arguments;
060      }
061   
062      public function getArguments()
063      {
064          return $this->arguments;
065      }
066   
067      public function needsEnvironment()
068      {
069          return $this->options['needs_environment'];
070      }
071   
072      public function needsContext()
073      {
074          return $this->options['needs_context'];
075      }
076   
077      public function getSafe(Twig_Node $filterArgs)
078      {
079          if (null !== $this->options['is_safe']) {
080              return $this->options['is_safe'];
081          }
082   
083          if (null !== $this->options['is_safe_callback']) {
084              return call_user_func($this->options['is_safe_callback'], $filterArgs);
085          }
086      }
087   
088      public function getPreservesSafety()
089      {
090          return $this->options['preserves_safety'];
091      }
092   
093      public function getPreEscape()
094      {
095          return $this->options['pre_escape'];
096      }
097   
098      public function isVariadic()
099      {
100          return $this->options['is_variadic'];
101      }
102   
103      public function isDeprecated()
104      {
105          return (bool) $this->options['deprecated'];
106      }
107   
108      public function getDeprecatedVersion()
109      {
110          return $this->options['deprecated'];
111      }
112   
113      public function getAlternative()
114      {
115          return $this->options['alternative'];
116      }
117  }
118