Welcome Guest, Not a member yet? Register   Sign In
can't create instance of a model class in models from controller class
#2

With CodeIgniter 4 everything has a namespace so you need to tell it the namespace that
a class lives in etc;

PHP Code:
use App\Models\ModelName

or

PHP Code:
$newModel App\Models\ModelName(); 

Sounds like your not give it the correct namespace.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: can't create instance of a model class in models from controller class - by InsiteFX - 11-11-2019, 06:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB