Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Route.php
Go to the documentation of this file.
1<?php
2
4
5use Attribute;
8
23#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
25
26 public string $path;
27 public ?array $methods;
28 public ?string $name;
29 public bool $cache;
30 public int $duration;
31 public bool $inherited;
32 public bool $automated;
33 public array $requirements;
34 public int $priority;
35
36 public function __construct(string $path = '', ?array $methods = null, ?string $name = null, ?bool $cache = false, ?int $duration = 0, ?bool $inherited = false, ?bool $automated = false, ?array $requirements = [], int $priority = 0) {
37 $this->path = $path ?? '';
38 $this->methods = $methods;
39 $this->name = $name;
40 $this->cache = $cache;
41 $this->duration = $duration;
42 $this->inherited = $inherited;
43 $this->automated = $automated;
44 $this->requirements = $requirements;
45 $this->priority = $priority;
46 }
47
48 public function getPropertiesAndValues($props = null) {
49 $r = parent::getPropertiesAndValues($props);
50 if (\is_subclass_of($this, Route::class)) {
51 unset($r['methods']);
52 }
53 return $r;
54 }
55}
56
Ubiquity\annotations$BaseAnnotationTrait This class is part of Ubiquity.
Ubiquity\attributes$BaseAttribute This class is part of Ubiquity.
__construct(string $path='', ?array $methods=null, ?string $name=null, ?bool $cache=false, ?int $duration=0, ?bool $inherited=false, ?bool $automated=false, ?array $requirements=[], int $priority=0)
Definition Route.php:36
Router annotations.
Definition Delete.php:3