protected function GeysirControllerBase::getParagraphTitle in Geysir 8
Returns the paragraph title set for the current paragraph field.
Parameters
$parent_entity_type: The entity type of the parent entity of this paragraphs field.
$parent_entity_bundle: The bundle of the parent entity of this paragraphs field.
$field: The machine name of the paragraphs field.
Return value
string The paragraph title set for the current paragraph field.
5 calls to GeysirControllerBase::getParagraphTitle()
- GeysirModalController::add in src/
Controller/ GeysirModalController.php - Create a modal dialog to add a single paragraph.
- GeysirModalController::addFirst in src/
Controller/ GeysirModalController.php - Create a modal dialog to add the first paragraph.
- GeysirModalController::delete in src/
Controller/ GeysirModalController.php - Create a modal dialog to delete a single paragraph.
- GeysirModalController::edit in src/
Controller/ GeysirModalController.php - Create a modal dialog to edit a single paragraph.
- GeysirModalController::translate in src/
Controller/ GeysirModalController.php - Create a modal dialog to translate a single paragraph.
File
- src/
Controller/ GeysirControllerBase.php, line 64
Class
Namespace
Drupal\geysir\ControllerCode
protected function getParagraphTitle($parent_entity_type, $parent_entity_bundle, $field) {
$form_mode = 'default';
$parent_field_settings = $this->entityTypeManager
->getStorage('entity_form_display')
->load($parent_entity_type . '.' . $parent_entity_bundle . '.' . $form_mode)
->getComponent($field);
$paragraph_title = isset($parent_field_settings['settings']['title']) ? $parent_field_settings['settings']['title'] : $this
->t('Paragraph');
return strtolower($paragraph_title);
}