You are here

public function YamlFormController::title in YAML Form 8

Route title callback.

Parameters

\Drupal\yamlform\YamlFormInterface|null $yamlform: A form.

Return value

string The form label as a render array.

5 string references to 'YamlFormController::title'
yamlform.routing.yml in ./yamlform.routing.yml
yamlform.routing.yml
yamlform.routing.yml in ./yamlform.routing.yml
yamlform.routing.yml
yamlform_devel.routing.yml in modules/yamlform_devel/yamlform_devel.routing.yml
modules/yamlform_devel/yamlform_devel.routing.yml
yamlform_node.routing.yml in modules/yamlform_node/yamlform_node.routing.yml
modules/yamlform_node/yamlform_node.routing.yml
yamlform_ui.routing.yml in modules/yamlform_ui/yamlform_ui.routing.yml
modules/yamlform_ui/yamlform_ui.routing.yml

File

src/Controller/YamlFormController.php, line 188

Class

YamlFormController
Provides route responses for form.

Namespace

Drupal\yamlform\Controller

Code

public function title(YamlFormInterface $yamlform = NULL) {

  /** @var \Drupal\Core\Entity\EntityInterface $source_entity */
  if (!$yamlform) {
    list($yamlform, $source_entity) = $this->requestHandler
      ->getYamlFormEntities();
  }
  else {
    $source_entity = $this->requestHandler
      ->getCurrentSourceEntity('yamlform');
  }
  return $source_entity ? $source_entity
    ->label() : $yamlform
    ->label();
}