Documentation

Stream extends AbstractTemplate
in package

View stream template class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
4.0.0

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 = []

$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 = []

$parent

View parent template

protected Stream|null $parent = 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|null

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|null
Parameters
$name : string
Return values
string|null

getMasterBlocks()

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

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>|null $data = null ]) : string
Parameters
$data : array<string|int, mixed>|null = null
Return values
string

setBlock()

Set block

public setBlock(string $name, string $value) : static
Parameters
$name : string
$value : string
Return values
static

setBlocks()

Set blocks

public setBlocks(array<string|int, mixed> $blocks) : static
Parameters
$blocks : array<string|int, mixed>
Return values
static

setMaster()

Set master

public setMaster(string $master) : static
Parameters
$master : string
Return values
static

setMasterBlock()

Set master block

public setMasterBlock(string $name, string $value) : static
Parameters
$name : string
$value : string
Return values
static

setMasterBlocks()

Set master blocks

public setMasterBlocks(array<string|int, mixed> $blocks) : static
Parameters
$blocks : array<string|int, mixed>
Return values
static

setTemplate()

Set view template with auto-detect

public setTemplate(string $template) : static
Parameters
$template : string
Return values
static

parseBlocks()

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

        
On this page

Search results