From b31d9f39250bc8be4302ae4e68c8dbaaa8800440 Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Tue, 22 Oct 2024 17:37:00 -0700 Subject: [PATCH] Add php to console debug function Signed-off-by: Justin Georgi --- includes/GlModelViewer.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/GlModelViewer.php b/includes/GlModelViewer.php index e1f257e..12910f3 100644 --- a/includes/GlModelViewer.php +++ b/includes/GlModelViewer.php @@ -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 = ''; + } + echo $command; + } } \ No newline at end of file