BlockView
class BlockView extends AbstractView (View source)
Work with the rendered view of a block.
$b = $this->getBlockObject();
$bv = new BlockView($b);
Traits
Properties
static protected | $requestInstance | from AbstractView | |
static protected | $requestInstances | from AbstractView | |
protected | $scopeItems | from AbstractView | |
$controller | from AbstractView | ||
protected | $template | from AbstractView | |
protected | $outputAssets | from AbstractView | |
protected | $block | ||
protected | $area | ||
protected | $blockType | ||
protected | $blockTypePkgHandle | ||
protected | $blockViewHeaderFile | ||
protected | $blockViewFooterFile | ||
protected | $outputContent | ||
protected | $viewToRender | ||
protected | $viewPerformed | ||
protected | $showControls | ||
protected | $didPullFromOutputCache |
Methods
No description
No description
Construct a block view object.
No description
No description
No description
No description
No description
Echo block contents.
url is a utility function that is used inside a view to setup urls w/tasks and parameters.
Given a block or page controller that we're rendering, we request all the features required by that block controller and then add them to the page's header/footer via requireAsset, if they're not already provided by the theme (which we check via getThemeSupportedFeatures)
No description
No description
No description
No description
No description
Returns a relative path to the current block's directory. If a filename is specified it will be appended and searched for as well.
No description
No description
No description
No description
No description
Legacy.
Fire an event just before the block is outputted on the page.
Details
getViewTemplate()
No description
addScopeItems($items)
No description
static
getRequestInstance()
No description
__construct(mixed $mixed = false)
No description
static protected
setRequestInstance(View $v)
No description
static protected
revertRequestInstance()
No description
start($state)
No description
startRender()
No description
protected
constructView($mixed)
Construct a block view object.
setupRender()
No description
finishRender($contents)
No description
action($task)
deprecated
deprecated
No description
addHeaderAsset($asset)
No description
addFooterAsset($asset)
No description
addOutputAsset($asset)
No description
requireAsset($assetType, $assetHandle = false)
No description
setController($controller)
No description
setViewTemplate($template)
No description
post($key, $defaultValue = null)
Returns the value of the item in the POST array.
protected
onBeforeGetContents()
No description
postProcessViewContents($contents)
No description
protected
onAfterGetContents()
No description
getScopeItems()
No description
render($state = false)
No description
renderViewContents($scopeItems)
Echo block contents.
static string
url(string $action, string $task = null)
deprecated
deprecated
url is a utility function that is used inside a view to setup urls w/tasks and parameters.
renderError($title, $error, $errorObj = null)
No description
addHeaderItem($item)
No description
addFooterItem($item)
No description
static View
getInstance()
Get an instance of the View.
Note: In versions before 8.5.0a3, this method may return 'false' if it's called after the page is rendered (for example in middleware).
protected void
handleRequiredFeatures(mixed $controller, Theme $theme)
Given a block or page controller that we're rendering, we request all the features required by that block controller and then add them to the page's header/footer via requireAsset, if they're not already provided by the theme (which we check via getThemeSupportedFeatures)
showControls()
No description
disableControls()
No description
setAreaObject(Area $area)
No description
getAreaObject()
No description
setBlockViewHeaderFile($file)
No description
setBlockViewFooterFile($file)
No description
string
getBlockPath($filename = null)
deprecated
deprecated
Returns the path to the current block's directory.
string
getBlockURL($filename = null)
Returns a relative path to the current block's directory. If a filename is specified it will be appended and searched for as well.
inc($fileToInclude, $args = [])
No description
protected
useBlockCache()
No description
field($field)
No description
usedBlockCacheDuringRender()
No description
runControllerTask()
No description
getThemePath()
Legacy.
private
fireOnBlockOutputEvent()
Fire an event just before the block is outputted on the page.
Custom code can modify the block contents before the block contents are 'echoed' out on the page.