Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter with HMVC modules strange inheritance
#1

[eluser]Martenvanurk[/eluser]
Dear,

I'm recode a project from our own CMS to a CodeIgniter project. I'm using CI in combination with the HMVC plugin. But through the project I discover some weird things.

First I want to describe my project.

I have one bootstrap file ( app/modules/front/Front.php ), in this bootstrap construct file I'm loading my most used helpers like uri, array etc.

In the bootstrap file, I'm reading the modules from the database and assign them in a position (TemplatePower) with the execution of Modules::Run(). In the modules which I'm assigning, a new TemplatePower object is opened ( different class (helper in the front and model in the modules) ) and the code is assigned in there. In the modules the code is echoed so the front controller can assign it.

But because I'm using our own CRUD class all the time, I converted this class in a model and placed it in the app/models folder and loaded in the front construct file.

In the most modules I can just load it by $this -> CrudModel without any problem. But in some modules it looks like the CI object is flushed and all my previous loaded classes are gone.

Maybe a point of interest: I'm loading models from the app/models and from the app/modules/<name>/models folder. Maybe that is causing this?

So how can the CI object be flushed? Sometimes I needed the CI object, but then I'm loading it like this:

Code:
$oCI =& get_instance();





Theme © iAndrew 2016 - Forum software by © MyBB