Bitrix API

LangAsset extends Asset

Class LangAsset

Table of Contents

Constants

CSS  = 'css'
JS  = 'js'
LANG  = 'lang'
LAYOUT  = 'layout'

Methods

__construct()  : mixed
Asset constructor.
create()  : CssAsset|JsAsset|LangAsset|LayoutAsset
Create asset instance.
deletePrefixes()  : array<string|int, mixed>
Delete prefixes in messages.
detectType()  : null|string
Detect type by path.
getContent()  : array<string|int, mixed>
Get content.
getName()  : string|null
Get name.
getPath()  : string
Get path.
getType()  : string
Get type.
getTypeList()  : array<string|int, mixed>
Get type list.
getUri()  : string|null
Get uri.
isExists()  : string
Return true if asset exists.
setContent()  : $this
Set content.
setPath()  : $this
Set path to resource.
setUri()  : $this
Set uri.
toCamelCase()  : array<string|int, mixed>
Convert messages to camel case.
useAllLangs()  : $this
Use all languages.

Constants

CSS

public mixed CSS = 'css'

LANG

public mixed LANG = 'lang'

LAYOUT

public mixed LAYOUT = 'layout'

Methods

__construct()

Asset constructor.

public __construct([string|null $path = null ]) : mixed
Parameters
$path : string|null = null

Path to resource.

deletePrefixes()

Delete prefixes in messages.

public static deletePrefixes(array<string|int, mixed> $messages, array<string|int, mixed> $prefixes) : array<string|int, mixed>
Parameters
$messages : array<string|int, mixed>

Messages.

$prefixes : array<string|int, mixed>

Prefixes.

Return values
array<string|int, mixed>

detectType()

Detect type by path.

public static detectType(string $path) : null|string
Parameters
$path : string

Relative path to asset.

Return values
null|string

getContent()

Get content.

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

getName()

Get name.

public getName() : string|null
Return values
string|null

getPath()

Get path.

public getPath() : string
Return values
string

getType()

Get type.

public getType() : string
Return values
string

getTypeList()

Get type list.

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

getUri()

Get uri.

public getUri() : string|null
Return values
string|null

isExists()

Return true if asset exists.

public static isExists(string $path) : string
Parameters
$path : string

Relative path.

Return values
string

setContent()

Set content.

public setContent(string|array<string|int, mixed> $content) : $this
Parameters
$content : string|array<string|int, mixed>

Content.

Return values
$this

setPath()

Set path to resource.

public setPath(string $path) : $this
Parameters
$path : string

Path to file.

Return values
$this

setUri()

Set uri.

public setUri(string|null $uri) : $this
Parameters
$uri : string|null

Uri.

Return values
$this

toCamelCase()

Convert messages to camel case.

public static toCamelCase(array<string|int, mixed> $messages) : array<string|int, mixed>
Parameters
$messages : array<string|int, mixed>

Messages.

Return values
array<string|int, mixed>

useAllLangs()

Use all languages.

public useAllLangs(bool $use) : $this
Parameters
$use : bool

Use.

Return values
$this

        
On this page

Search results