You are here

public function DoctrineDebug::exportAsRenderable in Devel 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/Devel/Dumper/DoctrineDebug.php \Drupal\devel\Plugin\Devel\Dumper\DoctrineDebug::exportAsRenderable()
  2. 8.2 src/Plugin/Devel/Dumper/DoctrineDebug.php \Drupal\devel\Plugin\Devel\Dumper\DoctrineDebug::exportAsRenderable()
  3. 4.x src/Plugin/Devel/Dumper/DoctrineDebug.php \Drupal\devel\Plugin\Devel\Dumper\DoctrineDebug::exportAsRenderable()

Returns a string representation of a variable wrapped in a render array.

Parameters

mixed $input: The variable to export.

string $name: (optional) The label to output before variable, defaults to NULL.

Return value

array String representation of a variable wrapped in a render array.

Overrides DevelDumperBase::exportAsRenderable

File

src/Plugin/Devel/Dumper/DoctrineDebug.php, line 46

Class

DoctrineDebug
Provides a DoctrineDebug dumper plugin.

Namespace

Drupal\devel\Plugin\Devel\Dumper

Code

public function exportAsRenderable($input, $name = NULL) {
  $output['container'] = [
    '#type' => 'details',
    '#title' => $name ?: $this
      ->t('Variable'),
    '#attached' => [
      'library' => [
        'devel/devel',
      ],
    ],
    '#attributes' => [
      'class' => [
        'container-inline',
        'devel-dumper',
        'devel-selectable',
      ],
    ],
    'export' => [
      '#markup' => $this
        ->export($input),
    ],
  ];
  return $output;
}