class ViewsPostRenderEvent in Hook Event Dispatcher 8.2
Same name and namespace in other branches
- 3.x modules/views_event_dispatcher/src/Event/Views/ViewsPostRenderEvent.php \Drupal\views_event_dispatcher\Event\Views\ViewsPostRenderEvent
Class ViewsPostRenderEvent.
Hierarchy
- class \Drupal\views_event_dispatcher\Event\Views\AbstractViewsEvent extends \Symfony\Component\EventDispatcher\Event implements EventInterface
- class \Drupal\views_event_dispatcher\Event\Views\ViewsPostRenderEvent
Expanded class hierarchy of ViewsPostRenderEvent
3 files declare their use of ViewsPostRenderEvent
- ExampleViewsEventSubscribers.php in examples/
ExampleViewsEventSubscribers.php - ViewEventTest.php in modules/
views_event_dispatcher/ tests/ src/ Unit/ Views/ ViewEventTest.php - views_event_dispatcher.module in modules/
views_event_dispatcher/ views_event_dispatcher.module - Views event dispatcher submodule.
File
- modules/
views_event_dispatcher/ src/ Event/ Views/ ViewsPostRenderEvent.php, line 12
Namespace
Drupal\views_event_dispatcher\Event\ViewsView source
class ViewsPostRenderEvent extends AbstractViewsEvent {
/**
* A renderable array containing the output of the view.
*
* @var array
*/
private $output;
/**
* The cache settings.
*
* @var \Drupal\views\Plugin\views\cache\CachePluginBase
*/
private $cache;
/**
* ViewsPreExecuteEevent constructor.
*
* @param \Drupal\views\ViewExecutable $view
* The view object about to be processed.
* @param string $output
* A flat string with the rendered output of the view.
* @param \Drupal\views\Plugin\views\cache\CachePluginBase $cache
* The cache settings.
*/
public function __construct(ViewExecutable $view, &$output, CachePluginBase $cache) {
parent::__construct($view);
$this->output =& $output;
$this->cache = $cache;
}
/**
* Get the cache settings.
*
* @return \Drupal\views\Plugin\views\cache\CachePluginBase
* The cache settings.
*/
public function getCache() : CachePluginBase {
return $this->cache;
}
/**
* Get the output render array.
*
* @return array
* A renderable array containing the output of the view.
*
* @see https://www.drupal.org/project/drupal/issues/2793169
* Drupal core issue regarding $output being documented as a string when it
* is in fact a render array.
*/
public function &getOutput() : array {
return $this->output;
}
/**
* {@inheritdoc}
*/
public function getDispatcherType() : string {
return HookEventDispatcherInterface::VIEWS_POST_RENDER;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractViewsEvent:: |
private | property | The view. | |
AbstractViewsEvent:: |
public | function | Get the view. | |
ViewsPostRenderEvent:: |
private | property | The cache settings. | |
ViewsPostRenderEvent:: |
private | property | A renderable array containing the output of the view. | |
ViewsPostRenderEvent:: |
public | function | Get the cache settings. | |
ViewsPostRenderEvent:: |
public | function |
Get the dispatcher type. Overrides EventInterface:: |
|
ViewsPostRenderEvent:: |
public | function | Get the output render array. | |
ViewsPostRenderEvent:: |
public | function |
ViewsPreExecuteEevent constructor. Overrides AbstractViewsEvent:: |