You are here

public function ConditionalFieldController::editFormTitle in Conditional Fields 8

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

Title for field settings form.

Parameters

string $entity_type: Entity type.

string $bundle: Entity bundle.

string $field_name: Field name.

Return value

string Page title.

File

src/Controller/ConditionalFieldController.php, line 117

Class

ConditionalFieldController
Returns responses for conditional_fields module routes.

Namespace

Drupal\conditional_fields\Controller

Code

public function editFormTitle($entity_type, $bundle, $field_name) {
  $instances = $this->entityFieldManager
    ->getFieldDefinitions($entity_type, $bundle);
  if (!isset($instances[$field_name])) {
    return '';
  }
  $field_instance = $instances[$field_name];
  return $field_instance
    ->getLabel();
}