public function EntityDisplayModeController::formModeTypeSelection in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/field_ui/src/Controller/EntityDisplayModeController.php \Drupal\field_ui\Controller\EntityDisplayModeController::formModeTypeSelection()
Provides a list of eligible entity types for adding form modes.
Return value
array A list of entity types to add a form mode for.
1 string reference to 'EntityDisplayModeController::formModeTypeSelection'
- field_ui.routing.yml in core/
modules/ field_ui/ field_ui.routing.yml - core/modules/field_ui/field_ui.routing.yml
File
- core/
modules/ field_ui/ src/ Controller/ EntityDisplayModeController.php, line 47 - Contains \Drupal\field_ui\Controller\EntityDisplayModeController.
Class
- EntityDisplayModeController
- Provides methods for entity display mode routes.
Namespace
Drupal\field_ui\ControllerCode
public function formModeTypeSelection() {
$entity_types = array();
foreach ($this
->entityManager()
->getDefinitions() as $entity_type_id => $entity_type) {
if ($entity_type
->get('field_ui_base_route') && $entity_type
->hasFormClasses()) {
$entity_types[$entity_type_id] = array(
'title' => $entity_type
->getLabel(),
'url' => Url::fromRoute('entity.entity_form_mode.add_form', array(
'entity_type_id' => $entity_type_id,
)),
'localized_options' => array(),
);
}
}
return array(
'#theme' => 'admin_block_content',
'#content' => $entity_types,
);
}