From 35393642fa18ed9bf36f14dde57e2a29b701a158 Mon Sep 17 00:00:00 2001 From: alextselegidis Date: Fri, 12 Nov 2021 16:32:31 +0100 Subject: [PATCH] Default value for the styles, scripts and global variables entry --- application/core/EA_Loader.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/application/core/EA_Loader.php b/application/core/EA_Loader.php index 0a733038..519c68b9 100644 --- a/application/core/EA_Loader.php +++ b/application/core/EA_Loader.php @@ -53,6 +53,12 @@ class EA_Loader extends CI_Loader { public function layout(string $layout, string $page, array $vars = [], bool $return = FALSE) { $vars['page_path'] = APPPATH . 'views/' . $page . '.php'; + + $vars['styles'] = $vars['styles'] ?? []; + + $vars['scripts'] = $vars['scripts'] ?? []; + + $vars['global_variables'] = $vars['global_variables'] ?? []; return $this->view($layout, $vars, $return); }