October\Rain\Html\BlockBuilder

BlockBuilder is used for building placeholders and putting content to them

Protected properties

protected array $blockStack

blockStack

protected array $blocks

blocks

Public methods

public void append($name, $content)

append a content of the layout block

Parameters
  • $name
  • $content

public void endBlock($append=false)

endBlock closes the layout block Append indicates that the new content should be appended to the existing block content

Parameters
  • $append

public void endPut($append=false)

endPut is a helper for endBlock and also clears the output buffer Append indicates that the new content should be appended to the existing block content

Parameters
  • $append

public void get($name, $default=NULL)

get returns the layout block contents but not deletes the block from memory

Parameters
  • $name
  • $default

public void placeholder($name, $default=NULL)

placeholder returns the layout block contents and deletes the block from memory.

Parameters
  • $name
  • $default

public void put($name)

put is a helper for startBlock

Parameters
  • $name

public void reset()

reset clears all the registered blocks

public void set($name, $content)

set a content of the layout block.

Parameters
  • $name
  • $content

public void startBlock($name)

startBlock begins the layout block

Parameters
  • $name