Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LinkBase.php

function LinkBase::addLangcode

Adds language information to the options.

Parameters

\Drupal\views\ResultRow $row: A view result row.

1 call to LinkBase::addLangcode()
LinkBase::renderLink in core/modules/views/src/Plugin/views/field/LinkBase.php
Prepares the link to view an entity.

File

core/modules/views/src/Plugin/views/field/LinkBase.php, line 224

Class

LinkBase
Field handler to present a link to an entity.

Namespace

Drupal\views\Plugin\views\field

Code

protected function addLangcode(ResultRow $row) {
    $entity = $this->getEntity($row);
    if ($entity && $this->languageManager
        ->isMultilingual()) {
        $this->options['alter']['language'] = $this->getEntityTranslationByRelationship($entity, $row)
            ->language();
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal