[eluser]Adods[/eluser]
I've added some lines to your helper and it works :cheese:.
here are the changes I've made :
Code:
class Module
{
function Module()
{
$this->_base = 'blocks/';
$this->load =& new Loader($this);
$this->load->_ci_assign_to_models();
$this->_assign_libraries();
log_message('debug', ucfirst(get_class($this))." module initialised");
}
.
.
.
class Loader extends CI_Loader
{
function Loader(&$_module)
{
parent::CI_Loader();
$this->module =& new Extended_Loader($_module, $this, $_module->_base);
$this->_module =& $_module;
}
.
.
.
class Extended_Loader
{
.
.
.
function view($view, $data = array(), $return = '')
{
$this->_load->_ci_view_path = APPPATH.$this->_base.get_class($this->_module).'/views/';
return $this->_load->view($view, $data, $return);
}
function model($model, $alias = '', $connect = '')
{
if ( ! class_exists('Model'))
{
load_class('Model', FALSE);
}
if ($connect) $this->_load->database();
$model = get_class($this->_module).'/'.$model;
if (!empty($alias))
{
$this->_module->$alias =& modules::load($model, 'models/');
}
else modules::load($model, 'models/');
$this->_module->_assign_libraries();
}
.
.
.
I hope you don't get mad because of it.
the problem is, I can't call the function in my model when using model alias.
it says that 'getViewableModules' method doesn't exist, the function can only be called using main name.
i mean, this call doesn't work:
$this->modelalias->method()
but this one works:
$this->modelname->method()