[Tfug] CodeIgniter Routing Question

keith smith klsmith2020 at yahoo.com
Mon Dec 3 15:12:55 MST 2012


Hi,

I'm rather new to CodeIgniter.

I'm going to rewrite an online app that contains 60+ tables.

I've written the code in the controller to manage one table.
The code is about 100 lines.
That means that to manage 60 tables will take up about 6000 lines of code in that one controller.

Controller Panel Configuration

SEGMENTS
1: Controller
2: Table
3: Action
4: ID or Start record for list.

For example to manage the pages table:

Added two lines to routes.php
$route['cp/pages']        = 'pages';
$route['cp/pages/(:any)'] = 'pages';

http://ci.dev/index.php/cp/pages/      : $route['cp/pages']        = 'pages';
http://ci.dev/index.php/cp/pages/list  : $route['cp/pages/(:any)'] = 'pages';

It appears I need two entries in the routing.php script for each controller.

If I create a controller for each table, Apache will only have to parse 200 lines of code vs 6000 (in controller only).

Any feedback is much appreciated.

I watched both of the CodeIgniter videos (before they were removed), read most of the user guide, read lots of posts, and read a book.  I have not found much in the way of how to deal with writing a CRUD for lots of tables.  I've found a lot of examples with one or two tables.

For what it is worth, EE has 2 controllers that weight in at 4500 line.  

Your opinion about using CI for a large web app with tens of thousands of visitors a day with lots of tables (60 - 100) is much appreciated. 

Thank you for your insight!

Keith 

------------------------

Keith Smith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tfug.org/pipermail/tfug_tfug.org/attachments/20121203/279d6a45/attachment.html>


More information about the tfug mailing list