Language.php

Definition of Drupal\taxonomy\Plugin\views\field\Language.

Namespace

Drupal\taxonomy\Plugin\views\field

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/Language.php
View source
<?php

/**
 * @file
 * Definition of Drupal\taxonomy\Plugin\views\field\Language.
 */
namespace Drupal\taxonomy\Plugin\views\field;

use Drupal\Component\Annotation\PluginID;

/**
 * Field handler to show the language of a taxonomy term.
 *
 * @PluginID("taxonomy_term_language")
 */
class Language extends Taxonomy {

  /**
   * Overrides Drupal\taxonomy\Plugin\views\field\Taxonomy::render().
   */
  public function render($values) {
    $value = $this
      ->getValue($values);
    $language = language_load($value);
    $value = $language ? $language->name : '';
    return $this
      ->render_link($this
      ->sanitizeValue($value), $values);
  }

}

Classes

Namesort descending Description
Language Field handler to show the language of a taxonomy term.