You are here

public function ViewsPhp::render in Views PHP 8

Same name in this branch
  1. 8 src/Plugin/views/area/ViewsPhp.php \Drupal\views_php\Plugin\views\area\ViewsPhp::render()
  2. 8 src/Plugin/views/field/ViewsPhp.php \Drupal\views_php\Plugin\views\field\ViewsPhp::render()

Render the area.

Parameters

bool $empty: (optional) Indicator if view result is empty or not. Defaults to FALSE.

Return value

array In any case we need a valid Drupal render array to return.

Overrides AreaPluginBase::render

File

src/Plugin/views/area/ViewsPhp.php, line 49
Definition of Drupal\views_php\Plugin\views\area\ViewsPhp.

Class

ViewsPhp
Views area PHP text handler.

Namespace

Drupal\views_php\Plugin\views\area

Code

public function render($empty = FALSE) {
  if (!$empty || !empty($this->options['empty'])) {
    return array(
      '#markup' => $this
        ->renderViewsPhp($this->options['content']),
    );
  }
  return array();
}