Welcome Guest, Not a member yet? Register   Sign In
Modular Separation - PHP5 (Modules)

[eluser]theprodigy[/eluser]
I have both the MY_Controller and MY_Model in the application/libraries folder (so that all controllers and models regardless of in a module or not can access them). So, CI should be picking these up, but it's only picking up the Controller extension.

The controller and model accessing these extensions are in a module.

The controller extending MY_Controller works as expected. The Model extending MY_Model throws a 'not found' error on the model trying to extend it (it finds the model, but not the MY_Model it is extending).

When I change the model extender to MX_Model (file name, class name, and extends declaration), it works as expected.

[eluser]wiredesignz[/eluser]
Extending MY_Model works perfectly fine here.

[eluser]wiredesignz[/eluser]
Modular Separation PHP5 has been updated and version 1.11 is now attached to the first post of this thread.

[eluser]hugle[/eluser]
Hello
downloaded version 1.10, installed, and after refresh, I spoted that 1.11 is already here, so downloaded the new one Smile we'll keep posted if some problems occur!Smile

thanks wiredesignz

[eluser]theprodigy[/eluser]
ok, not sure why it's not working for me.

folder structure (only relevant structure showing):
Quote:application
--site1
----config
----controllers
----libraries
------MY_Controller.php
------MY_Loader.php
------MY_Model.php
------MY_Router.php
----models
----modules
------news
--------controllers
----------news.php (extends MY_Controller) <---- works just fine
--------libraries
--------models
----------news_model.php (extends MY_Model) <---- throws error
--------views
----views
--site2
----[folder structure not shown]
system
--171
---- (CI 1.7.1 system folder structure)
--172
---- (CI 1.7.2 system folder structure)
public_html
--css
--images
--js
--index.php

[eluser]theprodigy[/eluser]
I just thought about it. Maybe it's the way I'm loading my models. I have the constructor of my MY_Controller loading the models. Is it possible that MY_Model just isn't loaded yet?

My MY_Controller constructor looks like this:
Code:
public function __construct()
{
    parent::__construct();
        
    foreach( $this->models as $model )
    {
        $this->load->model( $model . '_model', $model );
    }
}
Could this be the problem? If so, why would MX_Model be loaded but not MY_Model?

[eluser]Phil Sturgeon[/eluser]
[quote author="wiredesignz" date="1267418263"]Modular Separation PHP5 has been updated and version 1.11 is now attached to the first post of this thread.[/quote]

Any change you could maintain a changelog? I'm glad this is actively developed but I dont like updating just for the sake of it. :-)

[eluser]wiredesignz[/eluser]
Only one change to load->database() to match the HMVC update.
You know how to run a diff Phil. Wink

[eluser]Phil Sturgeon[/eluser]
HA cheeky bastard. Of course I ran a diff before committing the change, would be nice for at least a sentence saying "fixed bug a but doing thing b" when you announce a new version. :-P

[eluser]theprodigy[/eluser]
ok, I stopped loading the models in the MY_Controller constructor and I am still getting "Fatal error: Class 'MY_Model' not found in path/to/my/model.php on line 8". Please enlighten me on how to get this to work.
Thanks




Theme © iAndrew 2016 - Forum software by © MyBB