You are here

public function DevelDumperManager::exportAsRenderable in Devel 8.2

Same name and namespace in other branches
  1. 8.3 src/DevelDumperManager.php \Drupal\devel\DevelDumperManager::exportAsRenderable()
  2. 8 src/DevelDumperManager.php \Drupal\devel\DevelDumperManager::exportAsRenderable()
  3. 4.x src/DevelDumperManager.php \Drupal\devel\DevelDumperManager::exportAsRenderable()

Returns a render array representation of a variable.

Parameters

mixed $input: The variable to export.

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

string $plugin_id: (optional) The plugin ID, defaults to NULL.

Return value

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

Overrides DevelDumperManagerInterface::exportAsRenderable

File

src/DevelDumperManager.php, line 131

Class

DevelDumperManager
Class DevelDumperManager.

Namespace

Drupal\devel

Code

public function exportAsRenderable($input, $name = NULL, $plugin_id = NULL) {
  if ($this
    ->hasAccessToDevelInformation()) {
    return $this
      ->createInstance($plugin_id)
      ->exportAsRenderable($input, $name);
  }
  return [];
}