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

LogoutUrlExtension.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 1.69 KiB


01  <?php
02   
03  /*
04   * This file is part of the Symfony package.
05   *
06   * (c) Fabien Potencier <fabien@symfony.com>
07   *
08   * For the full copyright and license information, please view the LICENSE
09   * file that was distributed with this source code.
10   */
11   
12  namespace Symfony\Bridge\Twig\Extension;
13   
14  use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
15   
16  /**
17   * LogoutUrlHelper provides generator functions for the logout URL to Twig.
18   *
19   * @author Jeremy Mikola <jmikola@gmail.com>
20   */
21  class LogoutUrlExtension extends \Twig_Extension
22  {
23      private $generator;
24   
25      public function __construct(LogoutUrlGenerator $generator)
26      {
27          $this->generator = $generator;
28      }
29   
30      /**
31       * {@inheritdoc}
32       */
33      public function getFunctions()
34      {
35          return array(
36              new \Twig_SimpleFunction('logout_url', array($this, 'getLogoutUrl')),
37              new \Twig_SimpleFunction('logout_path', array($this, 'getLogoutPath')),
38          );
39      }
40   
41      /**
42       * Generates the relative logout URL for the firewall.
43       *
44       * @param string|null $key The firewall key or null to use the current firewall key
45       *
46       * @return string The relative logout URL
47       */
48      public function getLogoutPath($key = null)
49      {
50          return $this->generator->getLogoutPath($key);
51      }
52   
53      /**
54       * Generates the absolute logout URL for the firewall.
55       *
56       * @param string|null $key The firewall key or null to use the current firewall key
57       *
58       * @return string The absolute logout URL
59       */
60      public function getLogoutUrl($key = null)
61      {
62          return $this->generator->getLogoutUrl($key);
63      }
64   
65      /**
66       * {@inheritdoc}
67       */
68      public function getName()
69      {
70          return 'logout_url';
71      }
72  }
73