Welcome Guest, Not a member yet? Register   Sign In
Model Naming Conventions
#1

[eluser]MNDMatt[/eluser]
Hello! Just started with the framework last night, and have a quick question...

Can model names not be the same name as the controllers?

Code:
function Welcome(){

        parent::Controller();

        $this->load->model('welcome');

        $this->load->helper('welcome');

    }

When loading the "welcome" model it seems to crash. However, when I rename it to another welcome_model, for example, it works fine.

Is it not possible to keep the controllers, models, and helpers all the same name?

Thanks!
Matt
#2

[eluser]m4rw3r[/eluser]
No, PHP cannot have multiple classes with the same name. It issues a fatal error if it occurs.

So you just have to name them differently.

But I think you can have helpers with the same name as a controller or model (no classes in helpers).




Theme © iAndrew 2016 - Forum software by © MyBB