diff --git a/application/core/EA_Controller.php b/application/core/EA_Controller.php index a810273d..7d49bcd5 100644 --- a/application/core/EA_Controller.php +++ b/application/core/EA_Controller.php @@ -72,6 +72,8 @@ class EA_Controller extends CI_Controller { parent::__construct(); $this->configure_language(); + + $this->load_common_js_config(); } /** @@ -88,4 +90,16 @@ class EA_Controller extends CI_Controller { $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'), + ]); + } }