I am new to codeigniter and I want to make my program with multiple controllers. Can someone give me a link or a video link of a tutorial on how to make this possible or can someone here teach me? They always tell me to use h m v c but i don't think I can use h m v c yet.
Asked
Active
Viewed 688 times
-1
-
you can find good tutorials on http://tutorialcodeigniter.com/ – Renjith V R Feb 11 '16 at 14:15
-
also refer this -- http://stackoverflow.com/questions/31073491/how-do-you-use-multiple-controllers-in-codeigniter – Renjith V R Feb 11 '16 at 14:16
1 Answers
0
The information in https://ellislab.com/codeIgniter/user-guide/tutorial/index.html was most helpful to me.
Basically:
Create a class Use the config/routes.php file to assign you class methods to a route. For a usual Create, Read, Update and Delete functions the routes might look like this:
$route['equipments/create'] = 'equipments/create';
$route['equipments/update/(:any)'] = 'equipments/update/$1';
$route['equipments/view/(:any)'] = 'equipments/view/$1';
$route['equipments'] = 'equipments';
The left hand side is the url format and the right hand side is the class (equipments) and methods (create,update, etc). The '$1' after the slash is the parameters for the class.

Amit Chandrashekar Singh
- 363
- 4
- 16