3 namespace Drupal\devel;
5 use Drupal\Core\Render\Markup;
6 use Drupal\Core\Plugin\PluginBase;
9 * Defines a base devel dumper implementation.
11 * @see \Drupal\devel\Annotation\DevelDumper
12 * @see \Drupal\devel\DevelDumperInterface
13 * @see \Drupal\devel\DevelDumperPluginManager
16 abstract class DevelDumperBase extends PluginBase implements DevelDumperInterface {
21 public function dump($input, $name = NULL) {
22 echo (string) $this->export($input, $name);
28 public function exportAsRenderable($input, $name = NULL) {
29 return ['#markup' => $this->export($input, $name)];
33 * Wrapper for \Drupal\Core\Render\Markup::create().
35 * @param string $input
36 * The input string to mark as safe.
39 * The unaltered input value.
41 protected function setSafeMarkup($input) {
42 return Markup::create($input);