How to access CI model in a plain php file? |
If ratings.php is a class make it Ratings.php and put it in the Libraries folder and namespace it like:
<?php namespace App\Libraries; use App\Models\StarModel; class Ratings { protected $starModel; public function __construct() { $starmodel = new StarModel(); } }
Simpler is always better
|
Messages In This Thread |
How to access CI model in a plain php file? - by happyape - 10-16-2018, 07:27 AM
RE: How to access CI model in a plain php file? - by InsiteFX - 10-16-2018, 08:30 AM
RE: How to access CI model in a plain php file? - by happyape - 10-16-2018, 09:40 AM
RE: How to access CI model in a plain php file? - by donpwinston - 10-16-2018, 09:26 AM
RE: How to access CI model in a plain php file? - by happyape - 10-16-2018, 09:45 AM
RE: How to access CI model in a plain php file? - by sv3tli0 - 10-16-2018, 09:36 PM
|