Documentation

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

$cssFiles

protected array<string|int, mixed> $cssFiles = []

$jsFiles

protected array<string|int, mixed> $jsFiles = []

$layoutPath

protected string $layoutPath = ''

$tplData

protected array<string|int, mixed> $tplData = []

$sectionBase

private string $sectionBase = ''

Methods

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
$this

addData()

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
throws
Exception
Return values
$this

addJs()

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
$this

getData()

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|null

render()

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
throws
Exception
Return values
$this

setTemplate()

Sets the content template

public setTemplate(string $tpl) : $this
Parameters
$tpl : string

The content template

Tags
throws
Exception
Return values
$this

        
On this page

Search results