Load common JS config for all requests

This commit is contained in:
Alex Tselegidis 2021-12-14 07:59:11 +01:00
parent c761f6d37c
commit 58e38fd488

View file

@ -72,6 +72,8 @@ class EA_Controller extends CI_Controller {
parent::__construct(); parent::__construct();
$this->configure_language(); $this->configure_language();
$this->load_common_js_config();
} }
/** /**
@ -88,4 +90,16 @@ class EA_Controller extends CI_Controller {
$this->lang->load('translations'); $this->lang->load('translations');
} }
/**
* Load common JS config for all requests.
*/
private function load_common_js_config()
{
js_config([
'base_url' => config('base_url'),
'index_page' => config('index_page'),
'csrf_token' => config('csrf_token'),
]);
}
} }