Renderer
in package
Table of Contents
Properties
- $template : string
- $cssFiles : array<string|int, mixed>
- $jsFiles : array<string|int, mixed>
- $layout : string
- $layoutPath : string
- $tplData : array<string|int, mixed>
- $tplPath : string
- $appBase : string
- $bootstrap : Bootstrap
- $escaper : Escaper
- $sectionBase : string
Methods
- __construct() : mixed
- addCss() : $this
- Adds a css file to be included in the page
- addData() : $this
- Adds data to content template
- addJs() : $this
- Adds a JavaScript file to be included in the page
- getData() : int|float|string|array<string|int, mixed>|bool|null
- Returns content template data
- render() : void
- Renders the page
- renderCss() : string
- Returns html for adding css files to the page's head
- renderJs() : string
- Returns html for adding JavaScripts files to the page
- setLayout() : $this
- Sets the layout template
- setTemplate() : $this
- Sets the content template
Properties
$template
public
string
$template
= ''
$cssFiles
protected
array<string|int, mixed>
$cssFiles
= []
$jsFiles
protected
array<string|int, mixed>
$jsFiles
= []
$layout
protected
string
$layout
= ''
$layoutPath
protected
string
$layoutPath
= ''
$tplData
protected
array<string|int, mixed>
$tplData
= []
$tplPath
protected
string
$tplPath
= ''
$appBase
private
string
$appBase
= ''
$bootstrap
private
Bootstrap
$bootstrap
$escaper
private
Escaper
$escaper
$sectionBase
private
string
$sectionBase
= ''
Methods
__construct()
public
__construct(Bootstrap $bootstrap, Escaper $escaper) : mixed
Parameters
addCss()
Adds a css file to be included in the page
public
addCss(string $path) : $this
Parameters
- $path : string
-
Path to the css file
Return values
$thisaddData()
Adds data to content template
public
addData(string|int $key, int|float|string|array<string|int, mixed>|bool|null $data[, string $escape = 'html' ]) : $this
Parameters
- $key : string|int
- $data : int|float|string|array<string|int, mixed>|bool|null
- $escape : string = 'html'
Tags
Return values
$thisaddJs()
Adds a JavaScript file to be included in the page
public
addJs(string $src[, string $execMode = '' ]) : $this
Parameters
- $src : string
-
Script's source
- $execMode : string = ''
-
Loading/execution mode (async, defer)
Return values
$thisgetData()
Returns content template data
public
getData([string $key = null ]) : int|float|string|array<string|int, mixed>|bool|null
Parameters
- $key : string = null
Return values
int|float|string|array<string|int, mixed>|bool|nullrender()
Renders the page
public
render() : void
renderCss()
Returns html for adding css files to the page's head
public
renderCss() : string
Return values
string —$cssHTML
renderJs()
Returns html for adding JavaScripts files to the page
public
renderJs() : string
Return values
string —$jsHTML
setLayout()
Sets the layout template
public
setLayout(string $layout) : $this
Parameters
- $layout : string
-
The layout template
Tags
Return values
$thissetTemplate()
Sets the content template
public
setTemplate(string $tpl) : $this
Parameters
- $tpl : string
-
The content template