Welcome Guest, Not a member yet? Register   Sign In
Best practices for loading models in controllers in CI 4?
#5

I think it's good place to ask here about one other thing.

What if I want to use some model in only one function. It makes any diffrence to performance if I write:
PHP Code:
use App\Models\SomeModel;
class 
Myclass extends Backendcontroller
{

    public function testfunction()
    {
        $var = new SomeModel();
    }

or
PHP Code:
class Myclass extends Backendcontroller
{

    public function testfunction()
    {
        $var = new \App\Models\SomeModel();
    }

Reply


Messages In This Thread
RE: Best practices for loading models in controllers in CI 4? - by boddah85 - 10-21-2020, 12:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB