Commit 7df4628d by meier

D::show() um parameter htmlencode erweitert, schaltet htmlentities() für diese show an

1 parent 612ea079
Showing with 23 additions and 4 deletions
......@@ -82,6 +82,8 @@ class D {
if(trim($param_string)) {
if($param_htmlentities)
$param_string=htmlentities($param_string);
self::$echo_lines[self::$echo_count] = array(
'line' => $param_string,
'print' => $param_print,
......@@ -94,13 +96,25 @@ class D {
}
}
/**
* function htmlencode a string or array values ()
*
* @param array/string $param_val
*/
public static function htmlencode_arrayvalues($param_val){
if(is_array($param_val)){
foreach($param_val as $key => $value){
$param_val[$key]=self::htmlencode_arrayvalues($value);
};
return $param_val;
}
return htmlentities($param_val);
}
/**
* Funktion zeigt ein Objekt/Array html strukturiert an
* anstelle von var_dump
*/
public static function show($param_val, $param_string="", $param_print=true, $param_force=false) {
public static function show($param_val, $param_string="", $param_print=true, $param_force=false, $param_htmlentities=false) {
// self::new_echo("<br>______________________<br>", $param_print, $param_force);
......@@ -118,7 +132,12 @@ class D {
}
// self::new_echo("<pre>", $param_print, $param_force);
$string_show .= "<pre>";
if($param_htmlentities){
$param_val=self::htmlencode_arrayvalues($param_val);
}
self::new_echo($string_show.print_r($param_val, true).'"</pre>"', $param_print, $param_force);
//echo '#############################'.print_r($param_val, true).'####################';
// if(is_object($param_val)) {
// self::new_echo("<b>show(Objekt/Klassen Variablen)</b><pre>", $param_print, $param_force);
......@@ -180,7 +199,7 @@ class D {
* <ul><li>$param_string</li></ul>
*/
public static function ulli($param_string, $param_print=true, $param_force=false) {
// self::printCurrentFunction($param_print);
self::printCurrentFunction($param_print);
self::new_echo("<ul><li>".$param_string."</li></ul>", $param_print, $param_force);
}
/**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!