You are here

public function YamlFormTestController::title in YAML Form 8

Route title callback.

Parameters

\Drupal\yamlform\YamlFormInterface $yamlform: The form.

Return value

string The form label as a render array.

1 string reference to 'YamlFormTestController::title'
yamlform.routing.yml in ./yamlform.routing.yml
yamlform.routing.yml

File

src/Controller/YamlFormTestController.php, line 95

Class

YamlFormTestController
Provides route responses for form testing.

Namespace

Drupal\yamlform\Controller

Code

public function title(YamlFormInterface $yamlform) {

  /** @var \Drupal\yamlform\YamlFormInterface $yamlform */

  /** @var \Drupal\Core\Entity\EntityInterface $source_entity */
  list($yamlform, $source_entity) = $this->requestHandler
    ->getYamlFormEntities();
  return $this
    ->t('Testing %title form', [
    '%title' => $source_entity ? $source_entity
      ->label() : $yamlform
      ->label(),
  ]);
}