1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
package.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Web\WebPacker\Resource;
4
10
class
Package
11
{
13
protected
$list
= [];
14
protected
$onDemand
=
false
;
15
21
public
static
function
getOrderedTypeList
()
22
{
23
return
[
24
Asset::CSS
,
25
Asset::LANG
,
26
Asset::LAYOUT
,
27
Asset::JS
,
28
];
29
}
30
36
public
function
__construct
(
array
$assets = [])
37
{
38
foreach
($assets as $asset)
39
{
40
$this->
addAsset
($asset);
41
}
42
}
43
50
public
function
addAsset
(
Asset
$item)
51
{
52
$this->list[] = $item;
53
return
$this;
54
}
55
62
public
function
getAssets
(
$type
=
null
)
63
{
64
if
(
$type
)
65
{
66
$list
= [];
67
foreach
($this->list as $asset)
68
{
69
if
($asset->getType() !==
$type
)
70
{
71
continue
;
72
}
73
74
$list
[] = $asset;
75
}
76
77
return
$list
;
78
}
79
80
return
$this->list
;
81
}
82
89
public
function
onDemand
()
90
{
91
$this->
onDemand
=
true
;
92
return
$this;
93
}
94
100
public
function
isOnDemand
()
101
{
102
return
$this->onDemand
;
103
}
104
111
public
function
toArray
(
$type
=
null
)
112
{
113
$result
= [];
114
foreach
($this->list as $asset)
115
{
116
if
(
$type
&& $asset->getType() !=
$type
)
117
{
118
continue
;
119
}
120
121
$path
= $asset->getUri();
122
if
($this->
onDemand
&& !
$path
)
123
{
124
continue
;
125
}
126
127
$content
= $asset->getContent();
128
if
(!$this->
onDemand
&& !
$content
)
129
{
130
continue
;
131
}
132
133
$result
[] = [
134
'type'
=> $asset->getType(),
135
'path'
=>
$path
,
136
'content'
=>
$content
,
137
'cache'
=>
true
,
138
];
139
}
140
141
return
$result
;
142
}
143
}
$path
$path
Определения
access_edit.php:21
$type
$type
Определения
options.php:106
Bitrix\Main\Web\WebPacker\Resource\Asset
Определения
asset.php:16
Bitrix\Main\Web\WebPacker\Resource\Asset\LANG
const LANG
Определения
asset.php:20
Bitrix\Main\Web\WebPacker\Resource\Asset\JS
const JS
Определения
asset.php:17
Bitrix\Main\Web\WebPacker\Resource\Asset\LAYOUT
const LAYOUT
Определения
asset.php:19
Bitrix\Main\Web\WebPacker\Resource\Asset\CSS
const CSS
Определения
asset.php:18
Bitrix\Main\Web\WebPacker\Resource\Package
Определения
package.php:11
Bitrix\Main\Web\WebPacker\Resource\Package\toArray
toArray($type=null)
Определения
package.php:111
Bitrix\Main\Web\WebPacker\Resource\Package\$list
$list
Определения
package.php:13
Bitrix\Main\Web\WebPacker\Resource\Package\$onDemand
$onDemand
Определения
package.php:14
Bitrix\Main\Web\WebPacker\Resource\Package\onDemand
onDemand()
Определения
package.php:89
Bitrix\Main\Web\WebPacker\Resource\Package\isOnDemand
isOnDemand()
Определения
package.php:100
Bitrix\Main\Web\WebPacker\Resource\Package\getOrderedTypeList
static getOrderedTypeList()
Определения
package.php:21
Bitrix\Main\Web\WebPacker\Resource\Package\addAsset
addAsset(Asset $item)
Определения
package.php:50
Bitrix\Main\Web\WebPacker\Resource\Package\getAssets
getAssets($type=null)
Определения
package.php:62
Bitrix\Main\Web\WebPacker\Resource\Package\__construct
__construct(array $assets=[])
Определения
package.php:36
$content
$content
Определения
commerceml.php:144
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$result
$result
Определения
get_property_values.php:14
bitrix
modules
main
lib
web
webpacker
resource
package.php
Создано системой
1.14.0