1 | <?php |
||
14 | class Alias |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Absolute path to current view folder |
||
19 | * @var string |
||
20 | */ |
||
21 | public $currentViewPath; |
||
22 | |||
23 | /** |
||
24 | * Return full URL of current view folder |
||
25 | * @var string |
||
26 | */ |
||
27 | public $currentViewUrl; |
||
28 | |||
29 | /** |
||
30 | * Current app basic domain address, obtained from request |
||
31 | * @var string |
||
32 | */ |
||
33 | public $baseDomain; |
||
34 | |||
35 | /** |
||
36 | * Current app basic URL without language path |
||
37 | * @var string |
||
38 | */ |
||
39 | public $baseUrlNoLang; |
||
40 | |||
41 | /** |
||
42 | * Current app basic URL address, obtained from request |
||
43 | * @var string |
||
44 | */ |
||
45 | public $baseUrl; |
||
46 | |||
47 | /** |
||
48 | * Current app basic URL without any changes in pathway(lang-defined, etc) |
||
49 | * @var string |
||
50 | */ |
||
51 | public $scriptUrl; |
||
52 | |||
53 | |||
54 | /** |
||
55 | * Default vendor library's |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $vendorNamedLibrary = [ |
||
59 | 'js' => null, |
||
60 | 'css' => null |
||
61 | ]; |
||
62 | |||
63 | /** |
||
64 | * Custom code library's |
||
65 | * @var array |
||
66 | */ |
||
67 | protected $codeCustomLibrary = [ |
||
68 | 'js' => null, |
||
69 | 'css' => null |
||
70 | ]; |
||
71 | |||
72 | /** |
||
73 | * Custom code storage for templates |
||
74 | * @var array |
||
75 | */ |
||
76 | protected $plainCode = [ |
||
77 | 'js' => null, |
||
78 | 'css' => null |
||
79 | ]; |
||
80 | |||
81 | /** |
||
82 | * Alias constructor. Build alias properties for system data to provide fast-access from apps and other places. |
||
83 | */ |
||
84 | public function __construct() |
||
129 | |||
130 | /** |
||
131 | * Get vendor library url if defined by type and name. Example: getVendor('js', 'jquery') |
||
132 | * @param string $type |
||
133 | * @param string $name |
||
134 | * @return string|null |
||
135 | */ |
||
136 | public function getVendor($type, $name) |
||
140 | |||
141 | /** |
||
142 | * Set custom library $link by $type |
||
143 | * @param string $type |
||
144 | * @param string $link |
||
145 | */ |
||
146 | public function setCustomLibrary($type, $link) |
||
150 | |||
151 | /** |
||
152 | * Get custom library array by type |
||
153 | * @param string $type |
||
154 | * @return array|null |
||
155 | */ |
||
156 | public function getCustomLibraryArray($type) |
||
160 | |||
161 | /** |
||
162 | * Unset custom library's by type |
||
163 | * @param $type |
||
164 | */ |
||
165 | public function unsetCustomLibrary($type) |
||
169 | |||
170 | /** |
||
171 | * @param string $type |
||
172 | * @param string $code |
||
173 | * @return bool |
||
174 | */ |
||
175 | public function addPlainCode($type, $code) |
||
185 | |||
186 | /** |
||
187 | * Get plain code build container as string |
||
188 | * @param string $type |
||
189 | * @return null|string |
||
190 | */ |
||
191 | public function getPlainCode($type) |
||
195 | |||
196 | |||
197 | } |