-1

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.

John Hascall
  • 9,176
  • 6
  • 48
  • 72
kev_m
  • 325
  • 7
  • 30

1 Answers1

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.