‪TYPO3CMS  9.5
Route.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
22 class ‪Route
23 {
27  protected ‪$path = '/';
28 
32  protected ‪$options = [];
33 
40  public function ‪__construct(‪$path, ‪$options)
41  {
43  }
44 
50  public function ‪getPath()
51  {
52  return ‪$this->path;
53  }
54 
65  public function ‪setPath($pattern)
66  {
67  $this->path = '/' . ltrim(trim($pattern), '/');
68  return $this;
69  }
70 
76  public function ‪getOptions()
77  {
78  return ‪$this->options;
79  }
80 
89  public function ‪setOptions(array ‪$options)
90  {
91  $this->options = ‪$options;
92  return $this;
93  }
94 
104  public function ‪setOption($name, $value)
105  {
106  $this->options[$name] = $value;
107  return $this;
108  }
109 
116  public function ‪getOption($name)
117  {
118  return $this->options[$name] ?? null;
119  }
120 
127  public function ‪hasOption($name)
128  {
129  return array_key_exists($name, $this->options);
130  }
131 }
‪TYPO3\CMS\Backend\Routing\Route\setOptions
‪Route setOptions(array $options)
Definition: Route.php:87
‪TYPO3\CMS\Backend\Routing\Route\getPath
‪string getPath()
Definition: Route.php:48
‪TYPO3\CMS\Backend\Routing\Route\getOption
‪mixed getOption($name)
Definition: Route.php:114
‪TYPO3\CMS\Backend\Routing\Route\$options
‪array $options
Definition: Route.php:30
‪TYPO3\CMS\Backend\Routing\Route\getOptions
‪array getOptions()
Definition: Route.php:74
‪TYPO3\CMS\Backend\Routing\Route
Definition: Route.php:23
‪TYPO3\CMS\Backend\Routing\Route\setPath
‪Route setPath($pattern)
Definition: Route.php:63
‪TYPO3\CMS\Backend\Routing\Route\$path
‪string $path
Definition: Route.php:26
‪TYPO3\CMS\Backend\Routing\Route\__construct
‪__construct($path, $options)
Definition: Route.php:38
‪TYPO3\CMS\Backend\Routing\Route\hasOption
‪bool hasOption($name)
Definition: Route.php:125
‪TYPO3\CMS\Backend\Routing\Route\setOption
‪Route setOption($name, $value)
Definition: Route.php:102
‪TYPO3\CMS\Backend\Routing