Add php to console debug function

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-10-22 17:37:00 -07:00
parent 6b1e2400b9
commit b31d9f3925

View File

@@ -22,4 +22,11 @@ class GlModelViewer extends ImageHandler {
} }
} }
public static function console_log($data, $add_script_tags = false) {
$command = 'console.log('. json_encode($data, JSON_HEX_TAG).');';
if ($add_script_tags) {
$command = '<script>'. $command . '</script>';
}
echo $command;
}
} }