我正在使用CodeIgniter的HMVC扩展,我得到了2个模块
modules/frontpage
  -- controllers
    frontpage.php ( <- this controller needs to load the person model)
  -- models
  -- views
modules/person
  -- controllers
  -- models
    person_model.php ( defines Person_Model extends Model )
  -- views在frontpage控制器中使用$this->load->model('person_model')似乎只加载包含在同一模块(frontpage模型)中的全局或模型。
这里有CodeIgniter专家吗?
发布于 2010-06-29 05:26:03
找到了..。这是一个简单的解决办法。
只能使用:$this->load->model('person/person_model');
发布于 2012-12-20 15:33:02
根据我在另一个版本的codeigniter中的经验,加载模型的正确方法是$this-> load -> model ($model = 'person',$module = 'person');
发布于 2016-09-03 19:40:16
$rand=rand(1,9999999);
$currentModel="currentModel".$rand;
$this->load->model($call_model,$currentModel);
$call_method=$method;            
$currentMod=$currentModel;
$CI =& get_instance();
$re_data= $CI->$currentMod->$call_method($paramArr);https://stackoverflow.com/questions/3136116
复制相似问题