LayoutAsset extends Asset
Class LayoutAsset
Table of Contents
Constants
Methods
- __construct() : mixed
- Asset constructor.
- create() : CssAsset|JsAsset|LangAsset|LayoutAsset
- Create asset instance.
- detectType() : null|string
- Detect type by path.
- getContent() : string|null
- 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.
Constants
CSS
public
mixed
CSS
= 'css'
JS
public
mixed
JS
= 'js'
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.
create()
Create asset instance.
public
static create(string $path) : CssAsset|JsAsset|LangAsset|LayoutAsset
Parameters
- $path : string
-
Relative path to asset.
Tags
Return values
CssAsset|JsAsset|LangAsset|LayoutAssetdetectType()
Detect type by path.
public
static detectType(string $path) : null|string
Parameters
- $path : string
-
Relative path to asset.
Return values
null|stringgetContent()
Get content.
public
getContent() : string|null
Return values
string|nullgetName()
Get name.
public
getName() : string|null
Return values
string|nullgetPath()
Get path.
public
getPath() : string
Return values
stringgetType()
Get type.
public
getType() : string
Return values
stringgetTypeList()
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|nullisExists()
Return true if asset exists.
public
static isExists(string $path) : string
Parameters
- $path : string
-
Relative path.
Return values
stringsetContent()
Set content.
public
setContent(string|array<string|int, mixed> $content) : $this
Parameters
- $content : string|array<string|int, mixed>
-
Content.
Return values
$thissetPath()
Set path to resource.
public
setPath(string $path) : $this
Parameters
- $path : string
-
Path to file.
Return values
$thissetUri()
Set uri.
public
setUri(string|null $uri) : $this
Parameters
- $uri : string|null
-
Uri.