|
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('assetManager') facade. |
|
17
|
|
|
* |
|
18
|
|
|
* Methods |
|
19
|
|
|
* |
|
20
|
|
|
* @method static \yii\base\Behavior attachBehavior(string $name, string|array|\yii\base\Behavior $behavior) Attaches a behavior to this component. |
|
21
|
|
|
* @see \yii\base\Component::attachBehavior |
|
22
|
|
|
* |
|
23
|
|
|
* @method static void attachBehaviors(array $behaviors) Attaches a list of behaviors to the component. |
|
24
|
|
|
* @see \yii\base\Component::attachBehaviors |
|
25
|
|
|
* |
|
26
|
|
|
* @method static array behaviors() Returns a list of behaviors that this component should behave as. |
|
27
|
|
|
* @see \yii\base\Component::behaviors |
|
28
|
|
|
* |
|
29
|
|
|
* @method static null|\yii\base\Behavior detachBehavior(string $name) Detaches a behavior from the component. |
|
30
|
|
|
* @see \yii\base\Component::detachBehavior |
|
31
|
|
|
* |
|
32
|
|
|
* @method static void detachBehaviors() Detaches all behaviors from the component. |
|
33
|
|
|
* @see \yii\base\Component::detachBehaviors |
|
34
|
|
|
* |
|
35
|
|
|
* @method static void ensureBehaviors() Makes sure that the behaviors declared in [[behaviors()]] are attached to this component. |
|
36
|
|
|
* @see \yii\base\Component::ensureBehaviors |
|
37
|
|
|
* |
|
38
|
|
|
* @method static string|bool getAssetPath(\yii\web\AssetBundle $bundle, string $asset) Returns the actual file path for the specified asset. |
|
39
|
|
|
* @see \yii\web\AssetManager::getAssetPath |
|
40
|
|
|
* |
|
41
|
|
|
* @method static string getAssetUrl(\yii\web\AssetBundle $bundle, string $asset) Returns the actual URL for the specified asset. |
|
42
|
|
|
* @see \yii\web\AssetManager::getAssetUrl |
|
43
|
|
|
* |
|
44
|
|
|
* @method static null|\yii\base\Behavior getBehavior(string $name) Returns the named behavior object. |
|
45
|
|
|
* @see \yii\base\Component::getBehavior |
|
46
|
|
|
* |
|
47
|
|
|
* @method static \yii\base\Behavior[] getBehaviors() Returns all behaviors attached to this component. |
|
48
|
|
|
* @see \yii\base\Component::getBehaviors |
|
49
|
|
|
* |
|
50
|
|
|
* @method static \yii\web\AssetBundle getBundle(string $name, bool $publish = true) Returns the named asset bundle. |
|
51
|
|
|
* @see \yii\web\AssetManager::getBundle |
|
52
|
|
|
* |
|
53
|
|
|
* @method static \yii\web\AssetConverterInterface getConverter() Returns the asset converter. |
|
54
|
|
|
* @see \yii\web\AssetManager::getConverter |
|
55
|
|
|
* |
|
56
|
|
|
* @method static string|bool getPublishedPath(string $path) Returns the published path of a file path. |
|
57
|
|
|
* @see \yii\web\AssetManager::getPublishedPath |
|
58
|
|
|
* |
|
59
|
|
|
* @method static string|bool getPublishedUrl(string $path) Returns the URL of a published file path. |
|
60
|
|
|
* @see \yii\web\AssetManager::getPublishedUrl |
|
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 publish(string $path, array $options = []) Publishes a file or a directory. |
|
72
|
|
|
* @see \yii\web\AssetManager::publish |
|
73
|
|
|
* |
|
74
|
|
|
* @method static void setConverter(array|\yii\web\AssetConverterInterface $value) Sets the asset converter. |
|
75
|
|
|
* @see \yii\web\AssetManager::setConverter |
|
76
|
|
|
* |
|
77
|
|
|
* @method static void trigger(string $name, \yii\base\Event $event = null) Triggers an event. |
|
78
|
|
|
* @see \yii\base\Component::trigger |
|
79
|
|
|
* |
|
80
|
|
|
* Property accessors |
|
81
|
|
|
* |
|
82
|
|
|
* @method static callable getAfterCopy() Returns a PHP callback that is called after a sub-directory or file is successfully copied. |
|
83
|
|
|
* @see \yii\web\AssetManager::afterCopy |
|
84
|
|
|
* |
|
85
|
|
|
* @method static bool getAppendTimestamp() Returns whether to append a timestamp to the URL of every published asset. |
|
86
|
|
|
* @see \yii\web\AssetManager::appendTimestamp |
|
87
|
|
|
* |
|
88
|
|
|
* @method static array getAssetMap() Returns mapping from source asset files (keys) to target asset files (values). |
|
89
|
|
|
* @see \yii\web\AssetManager::assetMap |
|
90
|
|
|
* |
|
91
|
|
|
* @method static string getBasePath() Returns the root directory storing the published asset files. |
|
92
|
|
|
* @see \yii\web\AssetManager::basePath |
|
93
|
|
|
* |
|
94
|
|
|
* @method static string getBaseUrl() Returns the base URL through which the published asset files can be accessed. |
|
95
|
|
|
* @see \yii\web\AssetManager::baseUrl |
|
96
|
|
|
* |
|
97
|
|
|
* @method static callable getBeforeCopy() Returns a PHP callback that is called before copying each sub-directory or file. |
|
98
|
|
|
* @see \yii\web\AssetManager::beforeCopy |
|
99
|
|
|
* |
|
100
|
|
|
* @method static array|bool getBundles() Returns list of asset bundle configurations. |
|
101
|
|
|
* @see \yii\web\AssetManager::bundles |
|
102
|
|
|
* |
|
103
|
|
|
* @method static int getDirMode() Returns the permission to be set for newly generated asset directories. |
|
104
|
|
|
* @see \yii\web\AssetManager::dirMode |
|
105
|
|
|
* |
|
106
|
|
|
* @method static int getFileMode() Returns the permission to be set for newly published asset files. |
|
107
|
|
|
* @see \yii\web\AssetManager::fileMode |
|
108
|
|
|
* |
|
109
|
|
|
* @method static bool getForceCopy() Returns whether the directory being published should be copied even if it is found in the target directory. |
|
110
|
|
|
* @see \yii\web\AssetManager::forceCopy |
|
111
|
|
|
* |
|
112
|
|
|
* @method static callable getHashCallback() Returns a callback that will be called to produce hash for asset directory generation. |
|
113
|
|
|
* @see \yii\web\AssetManager::hashCallback |
|
114
|
|
|
* |
|
115
|
|
|
* @method static bool getLinkAssets() Returns whether to use symbolic link to publish asset files. |
|
116
|
|
|
* @see \yii\web\AssetManager::linkAssets |
|
117
|
|
|
* |
|
118
|
|
|
* @method static void setAfterCopy(callable $value) Sets a PHP callback that is called after a sub-directory or file is successfully copied. |
|
119
|
|
|
* @see \yii\web\AssetManager::afterCopy |
|
120
|
|
|
* |
|
121
|
|
|
* @method static void setAppendTimestamp(bool $value) Sets whether to append a timestamp to the URL of every published asset. |
|
122
|
|
|
* @see \yii\web\AssetManager::appendTimestamp |
|
123
|
|
|
* |
|
124
|
|
|
* @method static void setAssetMap(array $value) Sets mapping from source asset files (keys) to target asset files (values). |
|
125
|
|
|
* @see \yii\web\AssetManager::assetMap |
|
126
|
|
|
* |
|
127
|
|
|
* @method static void setBasePath(string $value) Sets the root directory storing the published asset files. |
|
128
|
|
|
* @see \yii\web\AssetManager::basePath |
|
129
|
|
|
* |
|
130
|
|
|
* @method static void setBaseUrl(string $value) Sets the base URL through which the published asset files can be accessed. |
|
131
|
|
|
* @see \yii\web\AssetManager::baseUrl |
|
132
|
|
|
* |
|
133
|
|
|
* @method static void setBeforeCopy(callable $value) Sets a PHP callback that is called before copying each sub-directory or file. |
|
134
|
|
|
* @see \yii\web\AssetManager::beforeCopy |
|
135
|
|
|
* |
|
136
|
|
|
* @method static void setBundles(array|bool $value) Sets list of asset bundle configurations. |
|
137
|
|
|
* @see \yii\web\AssetManager::bundles |
|
138
|
|
|
* |
|
139
|
|
|
* @method static void setDirMode(int $value) Sets the permission to be set for newly generated asset directories. |
|
140
|
|
|
* @see \yii\web\AssetManager::dirMode |
|
141
|
|
|
* |
|
142
|
|
|
* @method static void setFileMode(int $value) Sets the permission to be set for newly published asset files. |
|
143
|
|
|
* @see \yii\web\AssetManager::fileMode |
|
144
|
|
|
* |
|
145
|
|
|
* @method static void setForceCopy(bool $value) Sets whether the directory being published should be copied even if it is found in the target directory. |
|
146
|
|
|
* @see \yii\web\AssetManager::forceCopy |
|
147
|
|
|
* |
|
148
|
|
|
* @method static void setHashCallback(callable $value) Sets a callback that will be called to produce hash for asset directory generation. |
|
149
|
|
|
* @see \yii\web\AssetManager::hashCallback |
|
150
|
|
|
* |
|
151
|
|
|
* @method static void setLinkAssets(bool $value) Sets whether to use symbolic link to publish asset files. |
|
152
|
|
|
* @see \yii\web\AssetManager::linkAssets |
|
153
|
|
|
*/ |
|
154
|
|
|
class Asset extends Facade |
|
155
|
|
|
{ |
|
156
|
|
|
/** |
|
157
|
|
|
* @inheritDoc |
|
158
|
|
|
*/ |
|
159
|
1 |
|
public static function getFacadeComponentId() |
|
160
|
|
|
{ |
|
161
|
1 |
|
return 'assetManager'; |
|
162
|
|
|
} |
|
163
|
|
|
} |
|
164
|
|
|
|