mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 10:02:33 +03:00
Added config_helper.php class for fetching the configuration values in templates.
This commit is contained in:
parent
76dfb70685
commit
fb8aea0c3e
3 changed files with 27 additions and 2 deletions
|
@ -64,7 +64,7 @@ $autoload['libraries'] = array('database');
|
||||||
| $autoload['helper'] = array('url', 'file');
|
| $autoload['helper'] = array('url', 'file');
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$autoload['helper'] = array('custom_exceptions', 'url', 'file', 'language', 'asset');
|
$autoload['helper'] = array('custom_exceptions', 'url', 'file', 'language', 'asset', 'config');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
25
src/application/helpers/config_helper.php
Normal file
25
src/application/helpers/config_helper.php
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<?php defined('BASEPATH') OR exit('No direct script access allowed');
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* Easy!Appointments - Open Source Web Scheduler
|
||||||
|
*
|
||||||
|
* @package EasyAppointments
|
||||||
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
||||||
|
* @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);
|
||||||
|
}
|
|
@ -324,7 +324,7 @@
|
||||||
var GlobalVariables = {
|
var GlobalVariables = {
|
||||||
availableServices : <?= json_encode($available_services) ?>,
|
availableServices : <?= json_encode($available_services) ?>,
|
||||||
availableProviders : <?= json_encode($available_providers) ?>,
|
availableProviders : <?= json_encode($available_providers) ?>,
|
||||||
baseUrl : <?= json_encode(base_url()) ?>,
|
baseUrl : <?= json_encode(config('base_url')) ?>,
|
||||||
manageMode : <?= $manage_mode ? 'true' : 'false' ?>,
|
manageMode : <?= $manage_mode ? 'true' : 'false' ?>,
|
||||||
dateFormat : <?= json_encode($date_format) ?>,
|
dateFormat : <?= json_encode($date_format) ?>,
|
||||||
appointmentData : <?= json_encode($appointment_data) ?>,
|
appointmentData : <?= json_encode($appointment_data) ?>,
|
||||||
|
|
Loading…
Reference in a new issue