function String::title

Get the title this argument will assign the view, given the argument.

This usually needs to be overridden to provide a proper title.

Overrides ArgumentPluginBase::title

2 methods override String::title()
Type::title in drupal/core/modules/node/lib/Drupal/node/Plugin/views/argument/Type.php
Override the behavior of title(). Get the user friendly version of the node type.
VocabularyMachineName::title in drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/argument/VocabularyMachineName.php
Override the behavior of title(). Get the name of the vocabulary..

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument/String.php, line 253
Definition of Drupal\views\Plugin\views\argument\String.

Class

String
Basic argument handler to implement string arguments that may have length limits.

Namespace

Drupal\views\Plugin\views\argument

Code

function title() {
  $this->argument = $this
    ->caseTransform($this->argument, $this->options['case']);
  if (!empty($this->options['transform_dash'])) {
    $this->argument = strtr($this->argument, '-', ' ');
  }
  if (!empty($this->options['break_phrase'])) {
    $this
      ->breakPhraseString($this->argument, $this);
  }
  else {
    $this->value = array(
      $this->argument,
    );
    $this->operator = 'or';
  }
  if (empty($this->value)) {
    return !empty($this->definition['empty field name']) ? $this->definition['empty field name'] : t('Uncategorized');
  }
  if ($this->value === array(
    -1,
  )) {
    return !empty($this->definition['invalid input']) ? $this->definition['invalid input'] : t('Invalid input');
  }
  return implode($this->operator == 'or' ? ' + ' : ', ', $this
    ->title_query());
}