Welcome Guest, Not a member yet? Register   Sign In
How to access CI model in a plain php file?
#3

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
Reply


Messages In This Thread
RE: How to access CI model in a plain php file? - by donpwinston - 10-16-2018, 09:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB