Stream
extends AbstractTemplate
in package
View stream template class
Tags
Table of Contents
- $blocks : array<string|int, mixed>
- Block templates
- $data : array<string|int, mixed>
- View data
- $file : string
- View template file
- $master : string
- Master template
- $masterBlocks : array<string|int, mixed>
- Master block templates
- $output : string
- View output string
- $parent : Stream
- View parent template
- $template : string
- View template
- __construct() : mixed
- Constructor
- getBlock() : string
- Get block by name
- getBlocks() : array<string|int, mixed>
- Get blocks
- getMaster() : string
- Get master
- getMasterBlock() : string
- Get master block by name
- getMasterBlocks() : array<string|int, mixed>
- Get master blocks
- getParent() : Stream
- Get parent
- getTemplate() : string
- Get view template
- isFile() : bool
- Determine if the template stream is from a file
- isString() : bool
- Determine if the template stream is from a string
- render() : string
- Render the view and return the output
- setBlock() : Stream
- Set block
- setBlocks() : Stream
- Set blocks
- setMaster() : Stream
- Set master
- setMasterBlock() : Stream
- Set master block
- setMasterBlocks() : Stream
- Set master blocks
- setTemplate() : Stream
- Set view template with auto-detect
- parseBlocks() : void
- Parse template parent/child blocks
- parseIncludes() : void
- Parse template includes
- parseParent() : void
- Parse template parent/child blocks
- renderTemplate() : void
- Render view template string
Properties
$blocks
Block templates
protected
array<string|int, mixed>
$blocks
= []
$data
View data
protected
array<string|int, mixed>
$data
= []
$file
View template file
protected
string
$file
= null
$master
Master template
protected
string
$master
= null
$masterBlocks
Master block templates
protected
array<string|int, mixed>
$masterBlocks
= []
$output
View output string
protected
string
$output
= null
$parent
View parent template
protected
Stream
$parent
= null
$template
View template
protected
string
$template
= null
Methods
__construct()
Constructor
public
__construct(string $template) : mixed
Instantiate the view stream template object
Parameters
- $template : string
Return values
mixed —getBlock()
Get block by name
public
getBlock(string $name) : string
Parameters
- $name : string
Return values
string —getBlocks()
Get blocks
public
getBlocks() : array<string|int, mixed>
Return values
array<string|int, mixed> —getMaster()
Get master
public
getMaster() : string
Return values
string —getMasterBlock()
Get master block by name
public
getMasterBlock(string $name) : string
Parameters
- $name : string
Return values
string —getMasterBlocks()
Get master blocks
public
getMasterBlocks() : array<string|int, mixed>
Return values
array<string|int, mixed> —getParent()
Get parent
public
getParent() : Stream
Return values
Stream —getTemplate()
Get view template
public
getTemplate() : string
Return values
string —isFile()
Determine if the template stream is from a file
public
isFile() : bool
Return values
bool —isString()
Determine if the template stream is from a string
public
isString() : bool
Return values
bool —render()
Render the view and return the output
public
render([array<string|int, mixed> $data = null ]) : string
Parameters
- $data : array<string|int, mixed> = null
Return values
string —setBlock()
Set block
public
setBlock(string $name, string $value) : Stream
Parameters
- $name : string
- $value : string
Return values
Stream —setBlocks()
Set blocks
public
setBlocks(array<string|int, mixed> $blocks) : Stream
Parameters
- $blocks : array<string|int, mixed>
Return values
Stream —setMaster()
Set master
public
setMaster(string $master) : Stream
Parameters
- $master : string
Return values
Stream —setMasterBlock()
Set master block
public
setMasterBlock(string $name, string $value) : Stream
Parameters
- $name : string
- $value : string
Return values
Stream —setMasterBlocks()
Set master blocks
public
setMasterBlocks(array<string|int, mixed> $blocks) : Stream
Parameters
- $blocks : array<string|int, mixed>
Return values
Stream —setTemplate()
Set view template with auto-detect
public
setTemplate(string $template) : Stream
Parameters
- $template : string
Return values
Stream —parseBlocks()
Parse template parent/child blocks
protected
parseBlocks() : void
Return values
void —parseIncludes()
Parse template includes
protected
parseIncludes() : void
Return values
void —parseParent()
Parse template parent/child blocks
protected
parseParent() : void
Return values
void —renderTemplate()
Render view template string
protected
renderTemplate() : void