Document
in package
Document
This object is responsible for managing the basic properties of the document, such as meta information (title, description), plug-in scripts, styles.
Table of Contents
Properties
Methods
- addScript() : void
- Adds links to pluggable scripts with attributes.
- addStyle() : void
- Adds links to pluggable styles with attributes.
- getScripts() : array<string|int, mixed>
- Returns an array of scripts with attributes.
- getStyles() : array<string|int, mixed>
- Returns an array of styles with attributes.
- getTitle() : string
- This method returns the actual title of the document, can be called from anywhere in any controller.
- setTitle() : void
- This method sets the title of the document, can be called from anywhere in any controller.
- attrsToString() : string
- Helper method for converting an array of attributes to a string.
Properties
$scripts
private
array<string|int, mixed>
$scripts
= []
$styles
private
array<string|int, mixed>
$styles
= []
$title
private
string
$title
= ''
Methods
addScript()
Adds links to pluggable scripts with attributes.
public
addScript(string $url[, array<string|int, mixed> $attributes = [] ]) : void
Parameters
- $url : string
- $attributes : array<string|int, mixed> = []
addStyle()
Adds links to pluggable styles with attributes.
public
addStyle(string $url[, array<string|int, mixed> $attributes = [] ]) : void
Parameters
- $url : string
- $attributes : array<string|int, mixed> = []
getScripts()
Returns an array of scripts with attributes.
public
getScripts() : array<string|int, mixed>
Return values
array<string|int, mixed>getStyles()
Returns an array of styles with attributes.
public
getStyles() : array<string|int, mixed>
Return values
array<string|int, mixed>getTitle()
This method returns the actual title of the document, can be called from anywhere in any controller.
public
getTitle() : string
Return values
stringsetTitle()
This method sets the title of the document, can be called from anywhere in any controller.
public
setTitle(string $title) : void
Parameters
- $title : string
attrsToString()
Helper method for converting an array of attributes to a string.
private
attrsToString(array<string|int, mixed> $attributes) : string
Parameters
- $attributes : array<string|int, mixed>