RE: How to access config variable in codeigniter?

How to access config variable in codeigniter?

dip Team Leader Asked on June 7, 2018 in CODEIGNITER.
Add Comment
1 Answers

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’);

Senior Developer Answered on July 3, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.