You are here

public function ConditionalFieldController::formTitle in Conditional Fields 8

Same name and namespace in other branches
  1. 4.x src/Controller/ConditionalFieldController.php \Drupal\conditional_fields\Controller\ConditionalFieldController::formTitle()

Title for fields form.

Parameters

string $entity_type: Entity type.

string $bundle: Entity bundle.

Return value

string Page title.

File

src/Controller/ConditionalFieldController.php, line 96

Class

ConditionalFieldController
Returns responses for conditional_fields module routes.

Namespace

Drupal\conditional_fields\Controller

Code

public function formTitle($entity_type, $bundle) {
  $bundles = $this->entityTypeBundleInfo
    ->getBundleInfo($entity_type);
  if (!isset($bundles[$bundle]['label'])) {
    return '';
  }
  return $bundles[$bundle]['label'];
}