function DrupalVariable::exportAsRenderable

Overrides DevelDumperBase::exportAsRenderable

File

src/Plugin/Devel/Dumper/DrupalVariable.php, line 36

Class

DrupalVariable
Provides a DrupalVariable 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;
}