• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't access to config->item from routes.php

#2
You can try to define a variable called CAR_CONFIG and load it in your routes like this:

create file car_config:

PHP Code:
$car_config = array(
'route_car' => 'test'
);
//Add whatever data you want to the array and at the end of the file just add:
define('CAR_CONFIG'$car_config

In your routes.php file:

PHP Code:
#include the file
require_once APPPATH.'config/car_config.php';

//Use the variable
$route[CAR_CONFIG['route_car']] = //path to your controller here... 

That should normally work i think Smile
Reply


Messages In This Thread
RE: Can't access to config->item from routes.php - by bartMommens - 05-24-2019, 06:43 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.