<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     modifier.dbg.php
 * Type:     modifier
 * Name:     dbg
 * Purpose:  return a 'prettyfied' dump of a variable
 * -------------------------------------------------------------
 */

use CMSMSExt\core\VarDumper;

function smarty_modifier_dbg($var, $depth = 5, $highlight = TRUE) : string
{
  $out = '<pre style="word-wrap: break-word;">'
         . 'smarty modifier'
         . '<div style="word-wrap: break-word;">'
         . VarDumper::dump($var, $depth, $highlight)
         . '</div>'
         . '</pre>';
  
  return $out;
}

?>