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

(This post was last modified: 10-16-2018, 07:41 AM by happyape.)

I have file at this location of my CI4 project
Code:
CI4/public/star/ratings.php

My model file is at
Code:
CI4/Application/Models/StarModel.php

Is it possible to access this Model in the ratings.php?

I tried

Code:
<?php
use App\Models\StarModel;
$starmodel = new StarModel();
?>

I expected it not to work and it didn't. I know I need to get the namespace structure right. What's the correct way? Thanks
Reply


Messages In This Thread
How to access CI model in a plain php file? - by happyape - 10-16-2018, 07:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB