You are here

public function NameFormatter::getLastDelimitorBehaviors in Name Field 8

Defines the supported final delimitor behavior options.

Parameters

bool $include_examples: Flag to include examples in the options.

Return value

array Keyed options that are supported.

Overrides NameFormatterInterface::getLastDelimitorBehaviors

File

src/NameFormatter.php, line 271

Class

NameFormatter
Primary name formatter for an array of name components.

Namespace

Drupal\name

Code

public function getLastDelimitorBehaviors($include_examples = TRUE) {
  if ($include_examples) {
    return [
      'never' => $this
        ->t('Never (i.e. "J. Doe and T. Williams")'),
      'always' => $this
        ->t('Always (i.e. "J. Doe<strong>,</strong> and T. Williams")'),
      'contextual' => $this
        ->t('Contextual (i.e. "J. Doe and T. Williams" <em>or</em> "J. Doe, S. Smith<strong>,</strong> and T. Williams")'),
    ];
  }
  else {
    return [
      'never' => $this
        ->t('Never'),
      'always' => $this
        ->t('Always'),
      'contextual' => $this
        ->t('Contextual'),
    ];
  }
}