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 |
AddRequestFormatsListener.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\Component\HttpKernel\EventListener;
13
14 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
15 use Symfony\Component\HttpKernel\KernelEvents;
16 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
17
18 /**
19 * Adds configured formats to each request.
20 *
21 * @author Gildas Quemener <gildas.quemener@gmail.com>
22 */
23 class AddRequestFormatsListener implements EventSubscriberInterface
24 {
25 /**
26 * @var array
27 */
28 protected $formats;
29
30 /**
31 * @param array $formats
32 */
33 public function __construct(array $formats)
34 {
35 $this->formats = $formats;
36 }
37
38 /**
39 * Adds request formats.
40 *
41 * @param GetResponseEvent $event
42 */
43 public function onKernelRequest(GetResponseEvent $event)
44 {
45 foreach ($this->formats as $format => $mimeTypes) {
46 $event->getRequest()->setFormat($format, $mimeTypes);
47 }
48 }
49
50 /**
51 * {@inheritdoc}
52 */
53 public static function getSubscribedEvents()
54 {
55 return array(KernelEvents::REQUEST => 'onKernelRequest');
56 }
57 }
58