‪TYPO3CMS  10.4
Route.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
23 class ‪Route
24 {
28  protected ‪$path = '/';
29 
33  protected ‪$options = [];
34 
41  public function ‪__construct(‪$path, ‪$options)
42  {
44  }
45 
51  public function ‪getPath()
52  {
53  return ‪$this->path;
54  }
55 
66  public function ‪setPath($pattern)
67  {
68  $this->path = '/' . ltrim(trim($pattern), '/');
69  return $this;
70  }
71 
77  public function ‪getOptions()
78  {
79  return ‪$this->options;
80  }
81 
90  public function ‪setOptions(array ‪$options)
91  {
92  $this->options = ‪$options;
93  return $this;
94  }
95 
105  public function ‪setOption($name, $value)
106  {
107  $this->options[$name] = $value;
108  return $this;
109  }
110 
117  public function ‪getOption($name)
118  {
119  return $this->options[$name] ?? null;
120  }
121 
128  public function ‪hasOption($name)
129  {
130  return array_key_exists($name, $this->options);
131  }
132 }
‪TYPO3\CMS\Backend\Routing\Route\setOptions
‪Route setOptions(array $options)
Definition: Route.php:88
‪TYPO3\CMS\Backend\Routing\Route\getPath
‪string getPath()
Definition: Route.php:49
‪TYPO3\CMS\Backend\Routing\Route\getOption
‪mixed getOption($name)
Definition: Route.php:115
‪TYPO3\CMS\Backend\Routing\Route\$options
‪array $options
Definition: Route.php:31
‪TYPO3\CMS\Backend\Routing\Route\getOptions
‪array getOptions()
Definition: Route.php:75
‪TYPO3\CMS\Backend\Routing\Route
Definition: Route.php:24
‪TYPO3\CMS\Backend\Routing\Route\setPath
‪Route setPath($pattern)
Definition: Route.php:64
‪TYPO3\CMS\Backend\Routing\Route\$path
‪string $path
Definition: Route.php:27
‪TYPO3\CMS\Backend\Routing\Route\__construct
‪__construct($path, $options)
Definition: Route.php:39
‪TYPO3\CMS\Backend\Routing\Route\hasOption
‪bool hasOption($name)
Definition: Route.php:126
‪TYPO3\CMS\Backend\Routing\Route\setOption
‪Route setOption($name, $value)
Definition: Route.php:103
‪TYPO3\CMS\Backend\Routing