Default value for the styles, scripts and global variables entry

This commit is contained in:
alextselegidis 2021-11-12 16:32:31 +01:00
parent d96e65792b
commit 35393642fa

View file

@ -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);
}