Bitrix API

Manager

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

Table of Contents

Methods

__construct()  : mixed
Manager constructor.
addAsset()  : static
Recursive (by 'rel' key) adding assets in WP packege
addString()  : void
Add asset string
enableSandbox()  : $this
Create isolated environment.
getInstance()  : Manager
Singleton instance.
getMode()  : string
Get current mode
getOutput()  : array<string|int, mixed>
Get all assets as normalized array by types
getStrings()  : array<string|int, mixed>
Return array of added strings (js or css)
rebuildWebpack()  : void
When updated assets files - need rebuild webpack file. Marked packs for all landing as "need rebuild".
rebuildWebpackForLanding()  : void
When updated assets files - need rebuild webpack file. Marked packs for current landing as "need rebuild".
setOutput()  : void
Add extensions on page
setStandartMode()  : static
Set standart mode of builder
setWebpackMode()  : static
Set webpack mode of builder

Methods

__construct()

Manager constructor.

public __construct() : mixed

addAsset()

Recursive (by 'rel' key) adding assets in WP packege

public addAsset(string|array<string|int, mixed> $code[, int|null $location = null ]) : static
Parameters
$code : string|array<string|int, mixed>
$location : int|null = null
  • Where will be placed asset.
Return values
static

addString()

Add asset string

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

enableSandbox()

Create isolated environment.

public enableSandbox() : $this

Extensions will not load to page, not checking core - just collect list

Return values
$this

getMode()

Get current mode

public getMode() : string
Return values
string

getOutput()

Get all assets as normalized array by types

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

getStrings()

Return array of added strings (js or css)

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

rebuildWebpack()

When updated assets files - need rebuild webpack file. Marked packs for all landing as "need rebuild".

public static rebuildWebpack() : void

rebuildWebpackForLanding()

When updated assets files - need rebuild webpack file. Marked packs for current landing as "need rebuild".

public static rebuildWebpackForLanding([mixed $lid = [] ]) : void
Parameters
$lid : mixed = []

setOutput()

Add extensions on page

public setOutput([int $lid = 0 ]) : void
Parameters
$lid : int = 0
  • ID of current landing.

setStandartMode()

Set standart mode of builder

public setStandartMode() : static
Return values
static

setWebpackMode()

Set webpack mode of builder

public setWebpackMode() : static
Return values
static

        
On this page

Search results