Documentation

BlockBuilder
in package

Block manager

Tags
author

Alexey Bobkov, Samuel Georges

Table of Contents

$blocks  : mixed
$blockStack  : mixed
append()  : void
Appends a content of the layout block.
endBlock()  : void
Closes the layout block.
endPut()  : void
Helper for endBlock and also clears the output buffer.
get()  : string
Returns the layout block contents but not deletes the block from memory.
placeholder()  : string
Returns the layout block contents and deletes the block from memory.
put()  : void
Helper for startBlock
reset()  : void
Clears all the registered blocks.
set()  : void
Sets a content of the layout block.
startBlock()  : void
Begins the layout block.

Properties

Methods

append()

Appends a content of the layout block.

public append(string $name, string $content) : void
Parameters
$name : string

Specifies the block name.

$content : string

Specifies the block content.

Return values
void —

endBlock()

Closes the layout block.

public endBlock([bool $append = false ]) : void
Parameters
$append : bool = false

Indicates that the new content should be appended to the existing block content.

Tags
throws
Exception

if there are no items in the block stack

Return values
void —

endPut()

Helper for endBlock and also clears the output buffer.

public endPut([bool $append = false ]) : void
Parameters
$append : bool = false

Indicates that the new content should be appended to the existing block content.

Tags
throws
Exception

if there are no items in the block stack

Return values
void —

get()

Returns the layout block contents but not deletes the block from memory.

public get(string $name[, string $default = null ]) : string
Parameters
$name : string

Specifies the block name.

$default : string = null

Specifies a default block value to use if the block requested is not exists.

Return values
string —

placeholder()

Returns the layout block contents and deletes the block from memory.

public placeholder(string $name[, string $default = null ]) : string
Parameters
$name : string

Specifies the block name.

$default : string = null

Specifies a default block value to use if the block requested is not exists.

Return values
string —

put()

Helper for startBlock

public put(string $name) : void
Parameters
$name : string

Specifies the block name.

Return values
void —

reset()

Clears all the registered blocks.

public reset() : void
Return values
void —

set()

Sets a content of the layout block.

public set(string $name, string $content) : void
Parameters
$name : string

Specifies the block name.

$content : string

Specifies the block content.

Tags
throws
Exception

if there are no items in the block stack

Return values
void —

startBlock()

Begins the layout block.

public startBlock(string $name) : void
Parameters
$name : string

Specifies the block name.

Return values
void —

Search results