Properties

$template

$template : string

View template

Type

string

$data

$data : array

View data

Type

array

$output

$output : string

View output string

Type

string

$file

$file : string

View template file

Type

string

$blocks

$blocks : array

Block templates

Type

array

$master

$master : string

Master template

Type

string

$masterBlocks

$masterBlocks : array

Master block templates

Type

array

Methods

getTemplate()

getTemplate() : string

Get view template

Returns

string

setTemplate()

setTemplate(string  $template) : \Pop\View\Template\Stream

Set view template with auto-detect

Parameters

string $template

Returns

\Pop\View\Template\Stream

render()

render(array  $data = null) : string

Render the view and return the output

Parameters

array $data

Returns

string

__construct()

__construct(string  $template) 

Constructor

Instantiate the view stream template object

Parameters

string $template

setMaster()

setMaster(string  $master) : \Pop\View\Template\Stream

Set master

Parameters

string $master

Returns

\Pop\View\Template\Stream

getBlocks()

getBlocks() : array

Get blocks

Returns

array

getBlock()

getBlock(string  $name) : string

Get block by name

Parameters

string $name

Returns

string

getMasterBlocks()

getMasterBlocks() : array

Get master blocks

Returns

array

getMasterBlock()

getMasterBlock(string  $name) : string

Get master block by name

Parameters

string $name

Returns

string

setBlocks()

setBlocks(array  $blocks) : \Pop\View\Template\Stream

Set blocks

Parameters

array $blocks

Returns

\Pop\View\Template\Stream

setBlock()

setBlock(string  $name, string  $value) : \Pop\View\Template\Stream

Set block

Parameters

string $name
string $value

Returns

\Pop\View\Template\Stream

setMasterBlocks()

setMasterBlocks(array  $blocks) : \Pop\View\Template\Stream

Set master blocks

Parameters

array $blocks

Returns

\Pop\View\Template\Stream

setMasterBlock()

setMasterBlock(string  $name, string  $value) : \Pop\View\Template\Stream

Set master block

Parameters

string $name
string $value

Returns

\Pop\View\Template\Stream

getMaster()

getMaster() : string

Get master

Returns

string

isFile()

isFile() : boolean

Determine if the template stream is from a file

Returns

boolean

isString()

isString() : boolean

Determine if the template stream is from a string

Returns

boolean

renderTemplate()

renderTemplate() : void

Render view template string

parseParent()

parseParent() : void

Parse template parent/child blocks

parseIncludes()

parseIncludes() : void

Parse template includes

parseBlocks()

parseBlocks() : void

Parse template parent/child blocks