1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Facades for Yii 2 |
4
|
|
|
* |
5
|
|
|
* Generated on Yii 2.0.12 |
6
|
|
|
* |
7
|
|
|
* @see https://github.com/sergeymakinen/yii2-facades |
8
|
|
|
* @copyright Copyright (c) 2016-2017 Sergey Makinen (https://makinen.ru) |
9
|
|
|
* @license https://github.com/sergeymakinen/yii2-facades/blob/master/LICENSE The MIT License |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace sergeymakinen\facades; |
13
|
|
|
|
14
|
|
|
/** @noinspection PhpUnnecessaryFullyQualifiedNameInspection */ |
15
|
|
|
/** |
16
|
|
|
* Yii::$app->get('urlManager') facade. |
17
|
|
|
* |
18
|
|
|
* Methods |
19
|
|
|
* |
20
|
|
|
* @method static void addRules(array $rules, bool $append = true) Adds additional URL rules. |
21
|
|
|
* @see \yii\web\UrlManager::addRules |
22
|
|
|
* |
23
|
|
|
* @method static \yii\base\Behavior attachBehavior(string $name, string|array|\yii\base\Behavior $behavior) Attaches a behavior to this component. |
24
|
|
|
* @see \yii\base\Component::attachBehavior |
25
|
|
|
* |
26
|
|
|
* @method static void attachBehaviors(array $behaviors) Attaches a list of behaviors to the component. |
27
|
|
|
* @see \yii\base\Component::attachBehaviors |
28
|
|
|
* |
29
|
|
|
* @method static array behaviors() Returns a list of behaviors that this component should behave as. |
30
|
|
|
* @see \yii\base\Component::behaviors |
31
|
|
|
* |
32
|
|
|
* @method static string createAbsoluteUrl(string|array $params, string|null $scheme = null) Creates an absolute URL using the given route and query parameters. |
33
|
|
|
* @see \yii\web\UrlManager::createAbsoluteUrl |
34
|
|
|
* |
35
|
|
|
* @method static string createUrl(string|array $params) Creates a URL using the given route and query parameters. |
36
|
|
|
* @see \yii\web\UrlManager::createUrl |
37
|
|
|
* |
38
|
|
|
* @method static null|\yii\base\Behavior detachBehavior(string $name) Detaches a behavior from the component. |
39
|
|
|
* @see \yii\base\Component::detachBehavior |
40
|
|
|
* |
41
|
|
|
* @method static void detachBehaviors() Detaches all behaviors from the component. |
42
|
|
|
* @see \yii\base\Component::detachBehaviors |
43
|
|
|
* |
44
|
|
|
* @method static void ensureBehaviors() Makes sure that the behaviors declared in [[behaviors()]] are attached to this component. |
45
|
|
|
* @see \yii\base\Component::ensureBehaviors |
46
|
|
|
* |
47
|
|
|
* @method static string getBaseUrl() Returns the base URL that is used by [[createUrl()]] to prepend to created URLs. |
48
|
|
|
* @see \yii\web\UrlManager::getBaseUrl |
49
|
|
|
* |
50
|
|
|
* @method static null|\yii\base\Behavior getBehavior(string $name) Returns the named behavior object. |
51
|
|
|
* @see \yii\base\Component::getBehavior |
52
|
|
|
* |
53
|
|
|
* @method static \yii\base\Behavior[] getBehaviors() Returns all behaviors attached to this component. |
54
|
|
|
* @see \yii\base\Component::getBehaviors |
55
|
|
|
* |
56
|
|
|
* @method static string getHostInfo() Returns the host info that is used by [[createAbsoluteUrl()]] to prepend to created URLs. |
57
|
|
|
* @see \yii\web\UrlManager::getHostInfo |
58
|
|
|
* |
59
|
|
|
* @method static string getScriptUrl() Returns the entry script URL that is used by [[createUrl()]] to prepend to created URLs. |
60
|
|
|
* @see \yii\web\UrlManager::getScriptUrl |
61
|
|
|
* |
62
|
|
|
* @method static bool hasEventHandlers(string $name) Returns a value indicating whether there is any handler attached to the named event. |
63
|
|
|
* @see \yii\base\Component::hasEventHandlers |
64
|
|
|
* |
65
|
|
|
* @method static bool off(string $name, callable $handler = null) Detaches an existing event handler from this component. |
66
|
|
|
* @see \yii\base\Component::off |
67
|
|
|
* |
68
|
|
|
* @method static void on(string $name, callable $handler, mixed $data = null, bool $append = true) Attaches an event handler to an event. |
69
|
|
|
* @see \yii\base\Component::on |
70
|
|
|
* |
71
|
|
|
* @method static array|bool parseRequest(\yii\web\Request $request) Parses the user request. |
72
|
|
|
* @see \yii\web\UrlManager::parseRequest |
73
|
|
|
* |
74
|
|
|
* @method static void setBaseUrl(string $value) Sets the base URL that is used by [[createUrl()]] to prepend to created URLs. |
75
|
|
|
* @see \yii\web\UrlManager::setBaseUrl |
76
|
|
|
* |
77
|
|
|
* @method static void setHostInfo(string $value) Sets the host info that is used by [[createAbsoluteUrl()]] to prepend to created URLs. |
78
|
|
|
* @see \yii\web\UrlManager::setHostInfo |
79
|
|
|
* |
80
|
|
|
* @method static void setScriptUrl(string $value) Sets the entry script URL that is used by [[createUrl()]] to prepend to created URLs. |
81
|
|
|
* @see \yii\web\UrlManager::setScriptUrl |
82
|
|
|
* |
83
|
|
|
* @method static void trigger(string $name, \yii\base\Event $event = null) Triggers an event. |
84
|
|
|
* @see \yii\base\Component::trigger |
85
|
|
|
* |
86
|
|
|
* Property accessors |
87
|
|
|
* |
88
|
|
|
* @method static \yii\caching\Cache|string getCache() Returns the cache object or the application component ID of the cache object. |
89
|
|
|
* @see \yii\web\UrlManager::cache |
90
|
|
|
* |
91
|
|
|
* @method static bool getEnablePrettyUrl() Returns whether to enable pretty URLs. |
92
|
|
|
* @see \yii\web\UrlManager::enablePrettyUrl |
93
|
|
|
* |
94
|
|
|
* @method static bool getEnableStrictParsing() Returns whether to enable strict parsing. |
95
|
|
|
* @see \yii\web\UrlManager::enableStrictParsing |
96
|
|
|
* |
97
|
|
|
* @method static \yii\web\UrlNormalizer|array|string|bool getNormalizer() Returns the configuration for [[UrlNormalizer]] used by this UrlManager. |
98
|
|
|
* @see \yii\web\UrlManager::normalizer |
99
|
|
|
* |
100
|
|
|
* @method static string getRouteParam() Returns the GET parameter name for route. |
101
|
|
|
* @see \yii\web\UrlManager::routeParam |
102
|
|
|
* |
103
|
|
|
* @method static array getRuleConfig() Returns the default configuration of URL rules. |
104
|
|
|
* @see \yii\web\UrlManager::ruleConfig |
105
|
|
|
* |
106
|
|
|
* @method static array getRules() Returns the rules for creating and parsing URLs when [[enablePrettyUrl]] is `true`. |
107
|
|
|
* @see \yii\web\UrlManager::rules |
108
|
|
|
* |
109
|
|
|
* @method static bool getShowScriptName() Returns whether to show entry script name in the constructed URL. |
110
|
|
|
* @see \yii\web\UrlManager::showScriptName |
111
|
|
|
* |
112
|
|
|
* @method static string getSuffix() Returns the URL suffix used when [[enablePrettyUrl]] is `true`. |
113
|
|
|
* @see \yii\web\UrlManager::suffix |
114
|
|
|
* |
115
|
|
|
* @method static void setCache(\yii\caching\Cache|string $value) Sets the cache object or the application component ID of the cache object. |
116
|
|
|
* @see \yii\web\UrlManager::cache |
117
|
|
|
* |
118
|
|
|
* @method static void setEnablePrettyUrl(bool $value) Sets whether to enable pretty URLs. |
119
|
|
|
* @see \yii\web\UrlManager::enablePrettyUrl |
120
|
|
|
* |
121
|
|
|
* @method static void setEnableStrictParsing(bool $value) Sets whether to enable strict parsing. |
122
|
|
|
* @see \yii\web\UrlManager::enableStrictParsing |
123
|
|
|
* |
124
|
|
|
* @method static void setNormalizer(\yii\web\UrlNormalizer|array|string|bool $value) Sets the configuration for [[UrlNormalizer]] used by this UrlManager. |
125
|
|
|
* @see \yii\web\UrlManager::normalizer |
126
|
|
|
* |
127
|
|
|
* @method static void setRouteParam(string $value) Sets the GET parameter name for route. |
128
|
|
|
* @see \yii\web\UrlManager::routeParam |
129
|
|
|
* |
130
|
|
|
* @method static void setRuleConfig(array $value) Sets the default configuration of URL rules. |
131
|
|
|
* @see \yii\web\UrlManager::ruleConfig |
132
|
|
|
* |
133
|
|
|
* @method static void setRules(array $value) Sets the rules for creating and parsing URLs when [[enablePrettyUrl]] is `true`. |
134
|
|
|
* @see \yii\web\UrlManager::rules |
135
|
|
|
* |
136
|
|
|
* @method static void setShowScriptName(bool $value) Sets whether to show entry script name in the constructed URL. |
137
|
|
|
* @see \yii\web\UrlManager::showScriptName |
138
|
|
|
* |
139
|
|
|
* @method static void setSuffix(string $value) Sets the URL suffix used when [[enablePrettyUrl]] is `true`. |
140
|
|
|
* @see \yii\web\UrlManager::suffix |
141
|
|
|
*/ |
142
|
|
|
class Router extends Facade |
143
|
|
|
{ |
144
|
|
|
/** |
145
|
|
|
* @inheritDoc |
146
|
|
|
*/ |
147
|
1 |
|
public static function getFacadeComponentId() |
148
|
|
|
{ |
149
|
1 |
|
return 'urlManager'; |
150
|
|
|
} |
151
|
|
|
} |
152
|
|
|
|