protected function Links::getLinks

Gets the list of links used by this field.

Return value

array The links which are used by the render function.

1 call to Links::getLinks()
Dropbutton::render in drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/Dropbutton.php
Render the dropdown button.

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/field/Links.php, line 57
Contains \Drupal\views\Plugin\views\field\Links.

Class

Links
A abstract handler which provides a collection of links.

Namespace

Drupal\views\Plugin\views\field

Code

protected function getLinks() {
  $links = array();
  foreach ($this->options['fields'] as $field) {
    if (empty($this->view->field[$field]->last_render_text)) {
      continue;
    }
    $title = $this->view->field[$field]->last_render_text;
    $path = '';
    if (!empty($this->view->field[$field]->options['alter']['path'])) {
      $path = $this->view->field[$field]->options['alter']['path'];
    }

    // Make sure that tokens are replaced for this paths as well.
    $tokens = $this
      ->getRenderTokens(array());
    $path = strip_tags(decode_entities(strtr($path, $tokens)));
    $links[$field] = array(
      'href' => $path,
      'title' => $title,
    );
    if (!empty($this->options['destination'])) {
      $links[$field]['query'] = drupal_get_destination();
    }
  }
  return $links;
}