You are here

protected function NameFormatParser::addComponent in Name Field 8

Adds a component.

Parameters

string $string: The token string to process.

string $modifiers: The modifiers to apply.

string $conditions: The conditional flags.

Return value

array The processed piece.

1 call to NameFormatParser::addComponent()
NameFormatParser::format in src/NameFormatParser.php
Formats an array of name components into the supplied format.

File

src/NameFormatParser.php, line 259

Class

NameFormatParser
Converts a name from an array of components into a defined format.

Namespace

Drupal\name

Code

protected function addComponent($string, &$modifiers = '', &$conditions = '') {
  $string = $this
    ->applyModifiers($string, $modifiers);
  $piece = [
    'value' => $string,
    'conditions' => $conditions,
  ];
  $conditions = '';
  $modifiers = '';
  return $piece;
}