X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fdevel%2Fsrc%2FPlugin%2FDevel%2FDumper%2FDrupalVariable.php;fp=web%2Fmodules%2Fcontrib%2Fdevel%2Fsrc%2FPlugin%2FDevel%2FDumper%2FDrupalVariable.php;h=3f38d15f25a7b44f918bc75cf293d582051f7583;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/devel/src/Plugin/Devel/Dumper/DrupalVariable.php b/web/modules/contrib/devel/src/Plugin/Devel/Dumper/DrupalVariable.php new file mode 100644 index 000000000..3f38d15f2 --- /dev/null +++ b/web/modules/contrib/devel/src/Plugin/Devel/Dumper/DrupalVariable.php @@ -0,0 +1,56 @@ +Drupal Variable class.") + * ) + */ +class DrupalVariable extends DevelDumperBase { + + /** + * {@inheritdoc} + */ + public function export($input, $name = NULL) { + $name = $name ? $name . ' => ' : ''; + $dump = '
' . $name . Variable::export($input) . '
'; + return $this->setSafeMarkup($dump); + } + + /** + * {@inheritdoc} + */ + 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; + } + + /** + * {@inheritdoc} + */ + public static function checkRequirements() { + return TRUE; + } + +}