public function Link::render_link

Same name in this branch
  1. 8.x drupal/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php \Drupal\node\Plugin\views\field\Link::render_link()
  2. 8.x drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php \Drupal\user\Plugin\views\field\Link::render_link()
  3. 8.x drupal/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php \Drupal\comment\Plugin\views\field\Link::render_link()

Alters the field to render a link.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

\stdClass $values: The current row of the views result.

Return value

string The acutal rendered text (without the link) of this field.

1 call to Link::render_link()
Link::render in drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php
Overrides \Drupal\views\Plugin\views\field\FieldPluginBase::render().
2 methods override Link::render_link()
LinkCancel::render_link in drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/LinkCancel.php
Overrides \Drupal\user\Plugin\views\field\Link::render_link().
LinkEdit::render_link in drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/LinkEdit.php
Overrides \Drupal\user\Plugin\views\field\Link::render_link().

File

drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php, line 76
Definition of Drupal\user\Plugin\views\field\Link.

Class

Link
Field handler to present a link to the user.

Namespace

Drupal\user\Plugin\views\field

Code

public function render_link(EntityInterface $entity, \stdClass $values) {
  $text = !empty($this->options['text']) ? $this->options['text'] : t('View');
  $this->options['alter']['make_link'] = TRUE;
  $uri = $entity
    ->uri();
  $this->options['alter']['path'] = $uri['path'];
  return $text;
}