You are here

public function DevelDumperBase::exportAsRenderable in Devel 8

Same name and namespace in other branches
  1. 8.3 src/DevelDumperBase.php \Drupal\devel\DevelDumperBase::exportAsRenderable()
  2. 8.2 src/DevelDumperBase.php \Drupal\devel\DevelDumperBase::exportAsRenderable()
  3. 4.x src/DevelDumperBase.php \Drupal\devel\DevelDumperBase::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 DevelDumperInterface::exportAsRenderable

3 methods override DevelDumperBase::exportAsRenderable()
AvailableTestDumper::exportAsRenderable in tests/modules/devel_dumper_test/src/Plugin/Devel/Dumper/AvailableTestDumper.php
Returns a string representation of a variable wrapped in a render array.
DoctrineDebug::exportAsRenderable in src/Plugin/Devel/Dumper/DoctrineDebug.php
Returns a string representation of a variable wrapped in a render array.
DrupalVariable::exportAsRenderable in src/Plugin/Devel/Dumper/DrupalVariable.php
Returns a string representation of a variable wrapped in a render array.

File

src/DevelDumperBase.php, line 28

Class

DevelDumperBase
Defines a base devel dumper implementation.

Namespace

Drupal\devel

Code

public function exportAsRenderable($input, $name = NULL) {
  return [
    '#markup' => $this
      ->export($input, $name),
  ];
}