public function ListingEmpty::render

Implements \Drupal\views\Plugin\views\area\AreaPluginBase::render().

Overrides AreaPluginBase::render

File

drupal/core/modules/node/lib/Drupal/node/Plugin/views/area/ListingEmpty.php, line 25
Contains \Drupal\node\Plugin\views\area\ListingEmpty.

Class

ListingEmpty
Defines an area plugin to display a node/add link.

Namespace

Drupal\node\Plugin\views\area

Code

public function render($empty = FALSE) {
  if (!$empty || !empty($this->options['empty'])) {
    $element = array(
      '#theme' => 'links',
      '#links' => array(
        array(
          'href' => 'node/add',
          'title' => t('Add new content'),
        ),
      ),
      '#access' => _node_add_access(),
    );
    return $element;
  }
  return array();
}