PartialStack

Manager class for stacking nested partials and keeping track of their components. Partial "objects" store the components used by that partial for deferred retrieval.

 class Cms\Classes\PartialStack

Properties

public $activePartial : array

The current partial "object" being rendered.

protected $partialStack : array

Collection of previously rendered partial "objects".

Methods

public addComponent ($alias, $componentObj)

Adds a component to the active partial stack.

Parameters
Property Description
$alias
mixed
$componentObj
mixed
Returns
mixed

public getComponent ($name)

Returns a component by its alias from the partial stack.

Parameters
Property Description
$name
mixed
Returns
mixed

public stackPartial ()

Partial entry point, appends a new partial to the stack.

Returns
mixed

public unstackPartial ()

Partial exit point, removes the active partial from the stack.

Returns
mixed

protected findComponentFromStack ($name, $stack)

Locates a component by its alias from the supplied stack.

Parameters
Property Description
$name
mixed
$stack
mixed
Returns
mixed
Copyright © 2023 Winter CMS