Welcome Guest, Not a member yet? Register   Sign In
Route using database information
#1

[eluser]WanWizard[/eluser]
Hello from this Newbie.

I'm planning to rewrite our current web framework (which has been around since the PHP3 days, and in dire need of a makeover), and the plan is to use this fantastic framework as the foundation.

While writing down the new architecture and design (yes, I'm old ;-)), I have stumbled upon an issue that I don't quite know how to address.

Our current system uses a 'content-tree', which is basically the URI structure of the site, and is stored in a database. The system administrator can map any leaf of the tree (a specific URI) to a function, either static content, a core module (p.e. user administration) or a custom application (p.e. products).

This means in CI terms (if I understand it correctly) that I need to route based on database contents. From what I gather I can do that in:
- /config/routes.php, generate a custom $route['(.*)'] = for every URI requested
issue: no database functionality here, no URI functionality here
- /system/application/libraries/MY_Router.php, and rewrite the _validate_request() function
I do have URI functionality here, but still no database access
- /system/application/controller/dispatcher.php, and use a $route['(.*)'] = "dispatcher";
I have all CI functionality here, but basically I need to duplicate router and CI core code here to be able to load the correct controller that is the result of the content-tree lookup. Not best practice either.

Anyone any thoughts on how to approach this?


Messages In This Thread
Route using database information - by El Forum - 11-06-2008, 10:49 AM
Route using database information - by El Forum - 11-06-2008, 02:43 PM
Route using database information - by El Forum - 11-06-2008, 03:13 PM
Route using database information - by El Forum - 11-06-2008, 04:20 PM
Route using database information - by El Forum - 11-06-2008, 04:32 PM
Route using database information - by El Forum - 11-06-2008, 04:58 PM
Route using database information - by El Forum - 11-06-2008, 04:59 PM
Route using database information - by El Forum - 11-06-2008, 05:01 PM
Route using database information - by El Forum - 11-06-2008, 05:02 PM
Route using database information - by El Forum - 11-06-2008, 05:29 PM
Route using database information - by El Forum - 11-06-2008, 05:33 PM
Route using database information - by El Forum - 11-06-2008, 05:48 PM
Route using database information - by El Forum - 11-06-2008, 05:48 PM
Route using database information - by El Forum - 11-06-2008, 05:51 PM
Route using database information - by El Forum - 11-06-2008, 05:55 PM
Route using database information - by El Forum - 11-06-2008, 06:04 PM
Route using database information - by El Forum - 11-06-2008, 06:08 PM
Route using database information - by El Forum - 11-06-2008, 06:11 PM
Route using database information - by El Forum - 11-06-2008, 06:21 PM
Route using database information - by El Forum - 11-06-2008, 06:32 PM
Route using database information - by El Forum - 11-06-2008, 06:46 PM
Route using database information - by El Forum - 11-06-2008, 06:57 PM
Route using database information - by El Forum - 11-07-2008, 04:27 AM
Route using database information - by El Forum - 11-07-2008, 01:46 PM
Route using database information - by El Forum - 01-28-2009, 05:13 PM
Route using database information - by El Forum - 02-06-2009, 12:31 AM
Route using database information - by El Forum - 05-13-2009, 02:33 AM
Route using database information - by El Forum - 05-13-2009, 03:14 AM
Route using database information - by El Forum - 05-13-2009, 03:24 AM
Route using database information - by El Forum - 05-14-2009, 03:54 AM
Route using database information - by El Forum - 05-26-2009, 10:06 AM
Route using database information - by El Forum - 05-27-2009, 03:13 AM
Route using database information - by El Forum - 05-27-2009, 04:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB