Verzeichnisstruktur phpBB-3.1.0
- Veröffentlicht
- 27.10.2014
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 |
ClosureLoader.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\Routing\Loader;
13
14 use Symfony\Component\Config\Loader\Loader;
15 use Symfony\Component\Routing\RouteCollection;
16
17 /**
18 * ClosureLoader loads routes from a PHP closure.
19 *
20 * The Closure must return a RouteCollection instance.
21 *
22 * @author Fabien Potencier <fabien@symfony.com>
23 *
24 * @api
25 */
26 class ClosureLoader extends Loader
27 {
28 /**
29 * Loads a Closure.
30 *
31 * @param \Closure $closure A Closure
32 * @param string|null $type The resource type
33 *
34 * @return RouteCollection A RouteCollection instance
35 *
36 * @api
37 */
38 public function load($closure, $type = null)
39 {
40 return call_user_func($closure);
41 }
42
43 /**
44 * {@inheritdoc}
45 *
46 * @api
47 */
48 public function supports($resource, $type = null)
49 {
50 return $resource instanceof \Closure && (!$type || 'closure' === $type);
51 }
52 }
53