function DrupalVariable::export

Overrides DevelDumperInterface::export

1 call to DrupalVariable::export()
DrupalVariable::exportAsRenderable in src/Plugin/Devel/Dumper/DrupalVariable.php
Returns a string representation of a variable wrapped in a render array.

File

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

Class

DrupalVariable
Provides a DrupalVariable dumper plugin.

Namespace

Drupal\devel\Plugin\Devel\Dumper

Code

public function export($input, $name = NULL) {
    $name = $name ? $name . ' => ' : '';
    $dump = Variable::export($input);
    // Run Xss::filterAdmin on the resulting string to prevent
    // cross-site-scripting (XSS) vulnerabilities.
    $dump = Xss::filterAdmin($dump);
    $dump = '<pre>' . $name . $dump . '</pre>';
    return $this->setSafeMarkup($dump);
}