We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f71921e commit 52ff455Copy full SHA for 52ff455
1 file changed
routes/helpers/base.php
@@ -4,6 +4,8 @@
4
Application helpers
5
*/
6
7
+use Monster\App\Models\Env;
8
+
9
// Load Thems
10
function view($path, $data = [])
11
{
@@ -15,5 +17,12 @@ function view($path, $data = [])
15
17
// include views folder path
16
18
$viewPath = 'views/' . $path . '.php';
19
20
+ $env = new Env('.env');
21
+ $javascript = $env->get("JAVASCRIPT_DATA");
22
23
+ if ($javascript == "true") {
24
+ echo "<script>let monster = JSON.parse('" . json_encode($data) . "')</script>";
25
+ }
26
27
include_once $viewPath;
-}
28
+}
0 commit comments