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 |
LogoutUrlExtension.php
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 use Twig\Extension\AbstractExtension;
16 use Twig\TwigFunction;
17
18 /**
19 * LogoutUrlHelper provides generator functions for the logout URL to Twig.
20 *
21 * @author Jeremy Mikola <jmikola@gmail.com>
22 */
23 class LogoutUrlExtension extends AbstractExtension
24 {
25 private $generator;
26
27 public function __construct(LogoutUrlGenerator $generator)
28 {
29 $this->generator = $generator;
30 }
31
32 /**
33 * {@inheritdoc}
34 */
35 public function getFunctions()
36 {
37 return [
38 new TwigFunction('logout_url', [$this, 'getLogoutUrl']),
39 new TwigFunction('logout_path', [$this, 'getLogoutPath']),
40 ];
41 }
42
43 /**
44 * Generates the relative logout URL for the firewall.
45 *
46 * @param string|null $key The firewall key or null to use the current firewall key
47 *
48 * @return string The relative logout URL
49 */
50 public function getLogoutPath($key = null)
51 {
52 return $this->generator->getLogoutPath($key);
53 }
54
55 /**
56 * Generates the absolute logout URL for the firewall.
57 *
58 * @param string|null $key The firewall key or null to use the current firewall key
59 *
60 * @return string The absolute logout URL
61 */
62 public function getLogoutUrl($key = null)
63 {
64 return $this->generator->getLogoutUrl($key);
65 }
66
67 /**
68 * {@inheritdoc}
69 */
70 public function getName()
71 {
72 return 'logout_url';
73 }
74 }
75