function DevelDumperManager::exportAsRenderable

Same name and namespace in other branches
  1. 8.x-1.x src/DevelDumperManager.php \Drupal\devel\DevelDumperManager::exportAsRenderable()
  2. 5.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 [];
}