File
- drupal/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php, line 54
- Definition of Drupal\user\Plugin\views\field\User.
Class
- User
- Field handler to provide simple renderer that allows linking to a user.
Namespace
Drupal\user\Plugin\views\field
Code
function render_link($data, $values) {
if (!empty($this->options['link_to_user']) && user_access('access user profiles') && ($entity = $this
->getEntity($values)) && $data !== NULL && $data !== '') {
$this->options['alter']['make_link'] = TRUE;
$uri = $entity
->uri();
$this->options['alter']['path'] = $uri['path'];
}
return $data;
}