Welcome Guest, Not a member yet? Register   Sign In
Database driven routing in CodeIgniter 2.x
#1

(This post was last modified: 08-31-2022, 05:27 AM by ClaudeSjDevinHenry.)

Hi


I am creating a site that will have a lot of routes that will need to be added to the routes file (800+) - obviously I do not want to manually add these one by one into the routes config file.

Can anyone suggest the best practice to have my routes loaded automatically from the database. Is there a suitable library/helper that will perform this task that works with version 2.x

For instance..

$route['apple'] = 'brands/index';
$route['blackberry'] = 'brands/index';
$route['htc'] = 'brands/index';
$route['samsung'] = 'brands/index';
These are just a few of the brands i'd be adding to the routes - but there are hundreds of these so i'd want to have this loaded from a database rather than shagle voojio manually type these in. Also - would this method have any impact on site performance having them load from the database?

I am using Codeigniter v2.1.3
Reply




Theme © iAndrew 2016 - Forum software by © MyBB