3 namespace Drupal\devel\Plugin\Devel\Dumper;
5 use Drupal\Component\Utility\Variable;
6 use Drupal\devel\DevelDumperBase;
9 * Provides a DrupalVariable dumper plugin.
12 * id = "drupal_variable",
13 * label = @Translation("Drupal variable."),
14 * description = @Translation("Wrapper for <a href='https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Component%21Utility%21Variable.php/class/Variable/8'>Drupal Variable</a> class.")
17 class DrupalVariable extends DevelDumperBase {
22 public function export($input, $name = NULL) {
23 $name = $name ? $name . ' => ' : '';
24 $dump = '<pre>' . $name . Variable::export($input) . '</pre>';
25 return $this->setSafeMarkup($dump);
31 public function exportAsRenderable($input, $name = NULL) {
32 $output['container'] = [
34 '#title' => $name ? : $this->t('Variable'),
36 'library' => ['devel/devel']
39 'class' => ['container-inline', 'devel-dumper', 'devel-selectable'],
42 '#markup' => $this->export($input),
52 public static function checkRequirements() {