Piotr Labudda 7 éve
szülő
commit
16e0f4c801
1 módosított fájl, 5 hozzáadás és 1 törlés
  1. 5 1
      SE/se-lib/DBG.php

+ 5 - 1
SE/se-lib/DBG.php

@@ -199,6 +199,9 @@ class DBG {
 	}
 	}
 
 
 	public static function nicePrint($variable, $varName, $params = []) {
 	public static function nicePrint($variable, $varName, $params = []) {
+		echo self::getNicePrint($variable, $varName, $params);
+	}
+	public static function getNicePrint($variable, $varName, $params = []) {
 		$col = ['green'=>'#96c178', 'red'=>'#de6b74', 'blue'=>'#55b5c1', 'bg-dark'=>'#282c34', 'white'=>'#abb2bf', 'orange'=>'#d19a66', 'violet'=>'#c476db'];
 		$col = ['green'=>'#96c178', 'red'=>'#de6b74', 'blue'=>'#55b5c1', 'bg-dark'=>'#282c34', 'white'=>'#abb2bf', 'orange'=>'#d19a66', 'violet'=>'#c476db'];
 		if (is_scalar($variable)) {
 		if (is_scalar($variable)) {
 			$outLines = [ V::strShort((string)$variable, 20), $variable ];
 			$outLines = [ V::strShort((string)$variable, 20), $variable ];
@@ -232,7 +235,8 @@ class DBG {
 			}
 			}
 		}
 		}
 		$maxHeight = V::get('maxHeight', '400px', $params);
 		$maxHeight = V::get('maxHeight', '400px', $params);
-		echo UI::h('details', ['style'=>"max-width:800px"], [
+
+		return UI::h('details', ['style'=>"max-width:800px"], [
 			UI::h('summary', ['style'=>"padding:3px 8px;border:1px solid #ccc;background-color:{$col['bg-dark']};color:{$col['white']};font-size:small"],
 			UI::h('summary', ['style'=>"padding:3px 8px;border:1px solid #ccc;background-color:{$col['bg-dark']};color:{$col['white']};font-size:small"],
 				($varName)
 				($varName)
 				?	'<b style="color:'.$col['red'].'">' . $varName . "</b> => " . htmlspecialchars(V::strShort($firstLine, 20))
 				?	'<b style="color:'.$col['red'].'">' . $varName . "</b> => " . htmlspecialchars(V::strShort($firstLine, 20))