Welcome Guest, Not a member yet? Register   Sign In
packpage path and class name conflicts
#1

[eluser]searain[/eluser]
I have some classes in different CI sites.

I then have another CI site, in this site there is a class which will use above classes from different CI sites.

How can I avoid the class name conflicts?

for example, that class will be using the following two classes from two different sites.

/site1/application/controllers/class1.php (class Class1)

/site2/application/controllers/class1.php (class Class1)

there will be conflicts due to they are all using Class1 as the class name, right?

Is there a simple solution to solve the name conflicts? or I just have to have a name ruling like prefix the controller with the site name, such as

/site1/application/controllers/site1_class1.php (class Site1_class1)

/site2/application/controllers/site2_class1.php (class Site2_Class1).

Next questions, I need to load the models in the above controllers.


So if I have models in


/site1/application/models/site1/class1_model.php (class Class1_model)
/site2/application/models/site2/class1_model.php (class Class1_model)

so in /site1/application/controllers/site1_class1.php, I will use $this->load->model('site1/Class1_model')

so in /site2/application/controllers/site2_class1.php, I will use $this->load->model('site2/Class1_model')

The when I have another class which will use both
/site1/application/controllers/site1_class1.php
and
/site2/application/controllers/site2_class1.php

Will the model name be a problem? When I load it, I specify the different folder name. So that should be enough to be sure that I load the right one. So that model name should not be a problem?

Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB