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 |
RouteTrait.php
001 <?php
002
003 /*
004 * This file is part of the Symfony package.
005 *
006 * (c) Fabien Potencier <fabien@symfony.com>
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 namespace Symfony\Component\Routing\Loader\Configurator\Traits;
013
014 use Symfony\Component\Routing\Route;
015 use Symfony\Component\Routing\RouteCollection;
016
017 trait RouteTrait
018 {
019 /**
020 * @var RouteCollection|Route
021 */
022 private $route;
023
024 /**
025 * Adds defaults.
026 *
027 * @return $this
028 */
029 final public function defaults(array $defaults)
030 {
031 $this->route->addDefaults($defaults);
032
033 return $this;
034 }
035
036 /**
037 * Adds requirements.
038 *
039 * @return $this
040 */
041 final public function requirements(array $requirements)
042 {
043 $this->route->addRequirements($requirements);
044
045 return $this;
046 }
047
048 /**
049 * Adds options.
050 *
051 * @return $this
052 */
053 final public function options(array $options)
054 {
055 $this->route->addOptions($options);
056
057 return $this;
058 }
059
060 /**
061 * Sets the condition.
062 *
063 * @param string $condition
064 *
065 * @return $this
066 */
067 final public function condition($condition)
068 {
069 $this->route->setCondition($condition);
070
071 return $this;
072 }
073
074 /**
075 * Sets the pattern for the host.
076 *
077 * @param string $pattern
078 *
079 * @return $this
080 */
081 final public function host($pattern)
082 {
083 $this->route->setHost($pattern);
084
085 return $this;
086 }
087
088 /**
089 * Sets the schemes (e.g. 'https') this route is restricted to.
090 * So an empty array means that any scheme is allowed.
091 *
092 * @param string[] $schemes
093 *
094 * @return $this
095 */
096 final public function schemes(array $schemes)
097 {
098 $this->route->setSchemes($schemes);
099
100 return $this;
101 }
102
103 /**
104 * Sets the HTTP methods (e.g. 'POST') this route is restricted to.
105 * So an empty array means that any method is allowed.
106 *
107 * @param string[] $methods
108 *
109 * @return $this
110 */
111 final public function methods(array $methods)
112 {
113 $this->route->setMethods($methods);
114
115 return $this;
116 }
117
118 /**
119 * Adds the "_controller" entry to defaults.
120 *
121 * @param callable|string $controller a callable or parseable pseudo-callable
122 *
123 * @return $this
124 */
125 final public function controller($controller)
126 {
127 $this->route->addDefaults(['_controller' => $controller]);
128
129 return $this;
130 }
131 }
132