[eluser]stormbytes[/eluser]
Man.. I'm still missing something - I just don't get the mechanics of this, and so I'm playing guessing games.
Here it is in actual context:
I've got a Model called "Assets_mod". I'd like to assign Catalog_mod to the 'catalog' property of Assets_mod.
So.. Here's Assets_mod:
Code:
if (! defined('BASEPATH')) exit('No direct script access');
include APPPATH. 'models/catalog_mod.php';
class Assets_mod extends Model {
public $catalog;
function __construct() {
parent::Model();
}
function catalog() {
$catalog =& get_instance();
$catalog->load->model('catalog_mod');
return $catalog = new Catalog();
}
}
Then, here's my Catalog_mod:
Code:
if (!defined('BASEPATH')) exit('No direct script access');
class Catalog_mod extends Model {
function __construct() {
parent::Model();
}
function test() {
echo "It works! - The catalog generated this!";
}
}
And in my controller, I'm trying to call the 'Catalog' method of the Assets model like so:
Code:
$data['catalog'] = $this->assets_mod->catalog->test();
I'm getting errors all around so obviously I'm just not grasping the principle of what's happening here.