Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access config items in CodeIgniter routing file

I need to access some config items within routes.php. The config file has been autoloaded. It seems like routes file is loading earlier in CI life cycle and mostly static. Is it still possible to do so?

Using constants may be an alternative. But I prefer configs in my scenario.

Can anyone please help me to accomplish this?

like image 655
Rajitha Bandara Avatar asked Feb 12 '26 15:02

Rajitha Bandara


1 Answers

$route[$this->config->item('cms')['admin']['folder']] = "project-cms/admin/index";

work for me

like image 147
Egor Sazanovich Avatar answered Feb 18 '26 12:02

Egor Sazanovich