How to access config variable in codeigniter?
How to access config variable in codeigniter?
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
Accessing $config variable:
To access the variables defined in the application/config/config.php in the other places in your application,
$this->config->item(‘item name’);
for example I have declared on config item called ‘index_page’ in our config file
$config[‘index_page’] = ‘index.php’;
to access this in your controller or views:
echo $this->config->item(‘index_page’);