You are here

public function DevelController::fieldInfoPage in Devel 8

Same name and namespace in other branches
  1. 8.3 src/Controller/DevelController.php \Drupal\devel\Controller\DevelController::fieldInfoPage()
  2. 8.2 src/Controller/DevelController.php \Drupal\devel\Controller\DevelController::fieldInfoPage()
  3. 4.x src/Controller/DevelController.php \Drupal\devel\Controller\DevelController::fieldInfoPage()

Builds the fields info overview page.

Return value

array Array of page elements to render.

1 string reference to 'DevelController::fieldInfoPage'
devel.routing.yml in ./devel.routing.yml
devel.routing.yml

File

src/Controller/DevelController.php, line 62

Class

DevelController
Returns responses for devel module routes.

Namespace

Drupal\devel\Controller

Code

public function fieldInfoPage() {
  $fields = FieldStorageConfig::loadMultiple();
  ksort($fields);
  $output['fields'] = $this->dumper
    ->exportAsRenderable($fields, $this
    ->t('Fields'));
  $field_instances = FieldConfig::loadMultiple();
  ksort($field_instances);
  $output['instances'] = $this->dumper
    ->exportAsRenderable($field_instances, $this
    ->t('Instances'));
  $bundles = \Drupal::service('entity_type.bundle.info')
    ->getAllBundleInfo();
  ksort($bundles);
  $output['bundles'] = $this->dumper
    ->exportAsRenderable($bundles, $this
    ->t('Bundles'));
  $field_types = \Drupal::service('plugin.manager.field.field_type')
    ->getUiDefinitions();
  ksort($field_types);
  $output['field_types'] = $this->dumper
    ->exportAsRenderable($field_types, $this
    ->t('Field types'));
  $formatter_types = \Drupal::service('plugin.manager.field.formatter')
    ->getDefinitions();
  ksort($formatter_types);
  $output['formatter_types'] = $this->dumper
    ->exportAsRenderable($formatter_types, $this
    ->t('Formatter types'));
  $widget_types = \Drupal::service('plugin.manager.field.widget')
    ->getDefinitions();
  ksort($widget_types);
  $output['widget_types'] = $this->dumper
    ->exportAsRenderable($widget_types, $this
    ->t('Widget types'));
  return $output;
}