You are here

class ViewsPostRenderEvent in Hook Event Dispatcher 8

Class ViewsPostRenderEvent.

Hierarchy

Expanded class hierarchy of ViewsPostRenderEvent

3 files declare their use of ViewsPostRenderEvent
ExampleViewsEventSubscribers.php in src/Example/ExampleViewsEventSubscribers.php
hook_event_dispatcher.module in ./hook_event_dispatcher.module
Hook event dispatcher module.
ViewEventTest.php in tests/src/Unit/Views/ViewEventTest.php

File

src/Event/Views/ViewsPostRenderEvent.php, line 12

Namespace

Drupal\hook_event_dispatcher\Event\Views
View source
class ViewsPostRenderEvent extends BaseViewsEvent {

  /**
   * A flat string with the rendered output of the view.
   *
   * @var string
   */
  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() {
    return $this->cache;
  }

  /**
   * Get the output string.
   *
   * @return string
   *   A flat string with the rendered output of the view.
   */
  public function &getOutput() {
    return $this->output;
  }

  /**
   * {@inheritdoc}
   */
  public function getDispatcherType() {
    return HookEventDispatcherInterface::VIEWS_POST_RENDER;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseViewsEvent::$view private property The view.
BaseViewsEvent::getView public function Get the view.
ViewsPostRenderEvent::$cache private property The cache settings.
ViewsPostRenderEvent::$output private property A flat string with the rendered output of the view.
ViewsPostRenderEvent::getCache public function Get the cache settings.
ViewsPostRenderEvent::getDispatcherType public function Get the dispatcher type. Overrides EventInterface::getDispatcherType
ViewsPostRenderEvent::getOutput public function Get the output string.
ViewsPostRenderEvent::__construct public function ViewsPreExecuteEevent constructor. Overrides BaseViewsEvent::__construct