![]() |
|
Creating the Model for CodeIgniter - Printable Version +- My Board (https://ellohost.com/forum) +-- Forum: Tutoriel EN (https://ellohost.com/forum/forumdisplay.php?fid=8) +--- Forum: Others (https://ellohost.com/forum/forumdisplay.php?fid=20) +--- Thread: Creating the Model for CodeIgniter (/showthread.php?tid=78) |
Creating the Model for CodeIgniter - aaron - 07-20-2023 Creating the Model for CodeIgniterOnce the database table has been created, begin working on the business logic. To do this, create a model that will retrieve the database values.
Models are placed in the public_html/app/Models directory so they won't interfere with the application's directory structure. Go to the Models directory and create a new PHP file called AgencyModel.php. <?php namespace App\Models; As you can see, the model class (AgencyModel) extends the generic Model class that CodeIgniter provides. Note that CodeIgniter requires all class names to begin with a capital letter. |