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