[eluser]iansane[/eluser]
Hi,
I thought at first this was a issue with hmvc and sparks because with the basic php-activerecord test running vardump(Test::all()) I would get error message
"undefined function Test::all() when using hmvc.
But with further testing (fresh install of CI 2.1.2 it seems the problem is in loading any model when using hmvc.
I have this structure
application
-------modules
-------------test
----------------controllers
----------------------test.php
----------------models
----------------------Test.php
And here's my code.
controllers/test.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class test extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->model('test/test');
echo Test::hello();
}
}
models/Test.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Test{
public function hello()
{
return "hello";
}
}
And here is the stacktrace from xdebug:
Code:
( ! ) Fatal error: Call to undefined method test::hello() in E:\sandbox\ciblog\application\modules\test\controllers\test.php on line 15
Call Stack
# Time Memory Function Location
1 0.0004 337312 {main}( ) ..\index.php:0
2 0.0006 338224 require_once( 'E:\sandbox\ciblog\system\core\CodeIgniter.php' ) ..\index.php:202
3 0.0058 603176 call_user_func_array ( ) ..\CodeIgniter.php:359
4 0.0058 603224 test->index( ) ..\CodeIgniter.php:359
Anyone see what I"m doing wrong here or is there something changed in the new version of CI?
Thanks