From fb8aea0c3eaa96f82bf9fa47cb4516e2e4d5cb4d Mon Sep 17 00:00:00 2001 From: alext Date: Mon, 15 Jan 2018 08:57:17 +0100 Subject: [PATCH] Added config_helper.php class for fetching the configuration values in templates. --- src/application/config/autoload.php | 2 +- src/application/helpers/config_helper.php | 25 +++++++++++++++++++++ src/application/views/appointments/book.php | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/application/helpers/config_helper.php diff --git a/src/application/config/autoload.php b/src/application/config/autoload.php index b529b6f8..b894a555 100644 --- a/src/application/config/autoload.php +++ b/src/application/config/autoload.php @@ -64,7 +64,7 @@ $autoload['libraries'] = array('database'); | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('custom_exceptions', 'url', 'file', 'language', 'asset'); +$autoload['helper'] = array('custom_exceptions', 'url', 'file', 'language', 'asset', 'config'); /* diff --git a/src/application/helpers/config_helper.php b/src/application/helpers/config_helper.php new file mode 100644 index 00000000..69582570 --- /dev/null +++ b/src/application/helpers/config_helper.php @@ -0,0 +1,25 @@ + + * @copyright Copyright (c) 2013 - 2017, Alex Tselegidis + * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 + * @link http://easyappointments.org + * @since v1.3.0 + * ---------------------------------------------------------------------------- */ + +/** + * Quickly fetch the value of a framework configuration. + * + * @param string $key Configuration key. + * + * @return mixed Returns the configuration value. + */ +function config($key) { + $framework = & get_instance(); + + return $framework->config->item($key); +} diff --git a/src/application/views/appointments/book.php b/src/application/views/appointments/book.php index 07d86aa9..76dfbf35 100644 --- a/src/application/views/appointments/book.php +++ b/src/application/views/appointments/book.php @@ -324,7 +324,7 @@ var GlobalVariables = { availableServices : , availableProviders : , - baseUrl : , + baseUrl : , manageMode : , dateFormat : , appointmentData : ,