Bitrix API

ResourceCollection

Class Manager Collect assets, sort by locations, set output in different modes (webpack or default)

Table of Contents

Methods

__construct()  : mixed
ResourceCollection constructor.
add()  : void
addString()  : void
Save asset string in collection (like a <script> or <link>)
getNormalized()  : array<string|int, mixed>
Sort by location and group by types
getPathes()  : array<string|int, mixed>
Return pathes of added resources
getSliceByLocation()  : ResourceCollection
Create new ResourceCollection object by location
getStrings()  : array<string|int, mixed>
Return added strings
isEmpty()  : bool
Return true is no added resources and no added strings
remove()  : void

Methods

add()

public add(string $path, string $type, int $location) : void
Parameters
$path : string
$type : string
$location : int

addString()

Save asset string in collection (like a <script> or <link>)

public addString(string $string) : void
Parameters
$string : string

getNormalized()

Sort by location and group by types

public getNormalized() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPathes()

Return pathes of added resources

public getPathes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getStrings()

Return added strings

public getStrings() : array<string|int, mixed>
Return values
array<string|int, mixed>

of strings

isEmpty()

Return true is no added resources and no added strings

public isEmpty() : bool
Return values
bool

remove()

public remove(array<string|int, mixed>|string $pathes) : void
Parameters
$pathes : array<string|int, mixed>|string
  • string or array of strings pathes to asset to delete from collection

        
On this page

Search results