SSViewer_DataPresenter
class SSViewer_DataPresenter extends SSViewer_Scope
This extends SSViewer_Scope to mix in data on top of what the item provides. This can be "global" data that is scope-independant (like BaseURL), or type-specific data that is layered on top cross-cut like (like $FirstLast etc).
It's separate from SSViewer_Scope to keep that fairly complex code as clean as possible.
Constants
ITEM |
|
ITEM_ITERATOR |
|
ITEM_ITERATOR_TOTAL |
|
POP_INDEX |
|
UP_INDEX |
|
CURRENT_INDEX |
|
ITEM_OVERLAY |
|
Methods
No description
Called at the start of every lookup chain by SSTemplateParser to indicate a new lookup from local scope
Reset the local scope - restores saved state to the "global" item stack. Typically called after a lookup chain has been completed
No description
$Up and $Top need to restore the overlay from the parent and top-level scope respectively.
Store the current overlay (as it doesn't directly apply to the new scope that's being pushed). We want to store the overlay against the next item "up" in the stack (hence upIndex), rather than the current item, because SSViewer_Scope::obj() has already been called and pushed the new item to the stack by this point
Now that we're going to jump up an item in the item stack, we need to restore the overlay that was previously stored against the next item "up" in the stack from the current one
No description
Look up injected value - it may be part of an "overlay" (arguments passed to <% include %>), set on the current item, part of an "underlay" ($Layout or $Content), or an iterator/global property
Details
at line 62
__construct($item, array $overlay = null, array $underlay = null, SSViewer_Scope $inheritedScope = null)
in SSViewer_Scope at line 122
object
getItem()
Returns the current "active" item
in SSViewer_Scope at line 132
SSViewer_Scope
locally()
Called at the start of every lookup chain by SSTemplateParser to indicate a new lookup from local scope
in SSViewer_Scope at line 154
resetLocalScope()
Reset the local scope - restores saved state to the "global" item stack. Typically called after a lookup chain has been completed
at line 292
mixed
getObj(string $name, array $arguments = [], bool $cache = false, string $cacheName = null)
at line 256
$this
obj(string $name, array $arguments = [], bool $cache = false, string $cacheName = null)
$Up and $Top need to restore the overlay from the parent and top-level scope respectively.
in SSViewer_Scope at line 241
object
self()
Gets the current object and resets the scope.
at line 208
SSViewer_Scope
pushScope()
Store the current overlay (as it doesn't directly apply to the new scope that's being pushed). We want to store the overlay against the next item "up" in the stack (hence upIndex), rather than the current item, because SSViewer_Scope::obj() has already been called and pushed the new item to the stack by this point
at line 234
SSViewer_Scope
popScope()
Now that we're going to jump up an item in the item stack, we need to restore the overlay that was previously stored against the next item "up" in the stack from the current one
in SSViewer_Scope at line 289
mixed
next()
Fast-forwards the current iterator to the next item
at line 304
mixed
__call(string $name, array $arguments)
at line 170
array|null
getInjectedValue(string $property, array $params, bool $cast = true)
Look up injected value - it may be part of an "overlay" (arguments passed to <% include %>), set on the current item, part of an "underlay" ($Layout or $Content), or an iterator/global property