\CI_Config

CodeIgniter Config Class

This class contains functions that enable config files to be managed

Summary

Methods
Properties
Constants
__construct()
load()
item()
slash_item()
site_url()
base_url()
system_url()
set_item()
_assign_to_config()
$config
$is_loaded
$_config_paths
No constants found
_uri_string()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$config

$config : array

List of all loaded config values

Type

array

$is_loaded

$is_loaded : array

List of all loaded config files

Type

array

$_config_paths

$_config_paths : array

List of paths to search when trying to load a config file

Type

array

Methods

__construct()

__construct() : boolean

Constructor

Sets the $config data from the primary config.php file as a class variable

Returns

boolean —

if the file was successfully loaded or not

load()

load(  $file = '',   $use_sections = FALSE,   $fail_gracefully = FALSE) : boolean

Load Config File

Parameters

$file
$use_sections
$fail_gracefully

Returns

boolean —

if the file was loaded correctly

item()

item(  $item,   $index = '') : string

Fetch a config file item

Parameters

$item
$index

Returns

string

slash_item()

slash_item(  $item) : string

Fetch a config file item - adds slash after item (if item is not empty)

Parameters

$item

Returns

string

site_url()

site_url(  $uri = '') : string

Site URL Returns base_url . index_page [. uri_string]

Parameters

$uri

Returns

string

base_url()

base_url(string  $uri = '') : string

Base URL Returns base_url [. uri_string]

Parameters

string $uri

Returns

string

system_url()

system_url() : string

System URL

Returns

string

set_item()

set_item(  $item,   $value) : void

Set a config file item

Parameters

$item
$value

_assign_to_config()

_assign_to_config(  $items = array()) : void

Assign to Config

This function is called by the front controller (CodeIgniter.php) after the Config class is instantiated. It permits config items to be assigned or overriden by variables contained in the index.php file

Parameters

$items

_uri_string()

_uri_string(  $uri) : string

Build URI string for use in Config::site_url() and Config::base_url()

Parameters

$uri

Returns

string