我无法加载HMVC中另一个模块的模型,Codeigniter框架的框架,我试过这样:
Class Contract extends MY_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('Contract_model', 'contract');
$this->load->model('register/customer_model', 'customer');
$this->load->model('register/daydue_model', 'due');
}
}
结构
在localhost中安静地工作,因为服务器给出了这个错误::
Message: Unable to locate the model you have specified: Daydue_model
答案 0 :(得分:1)
当您在服务器上传使用大小写敏感时,它不会在localhost上产生问题。您的型号名称不正确。
这样做
pi = 3.14159265359
radius = 10
height = radius * 2
import math
print ('{0: <10}'.format('radius'),\
'{0: <10}'.format('area'),\
'{0: <10}'.format('volume'))
while radius >= 9.5 and radius <= 20:
area = pi * radius * (radius + math.sqrt(height**2 + radius**2))
volume = pi * radius**2 * height / 3
print(format(radius, '<10,.2f'), \
format(area, '<10,.2f'), \
format(volume, '<12,.2f'))
radius = radius + .5
并将您的模型名称重命名为Daydue_model并检查类名称是否与模型名称相同:
$this->load->model('register/daydue_model', 'due');