本帖最后由 甲骨文 于 2012-11-8 14:03 编辑
Module ->Build
Class->Tool
library在 application/library/marketing/Discount.php
代码如下:
class Build_Tool_module extends CI_Controller
{
// 在不使用HMVC的情况下是OK的
public function discount()
{
$this->load->library('marketing/Discount');
var_dump($this->discount); // null
print_r($this->discount->buildTool());
}
}
错误:
A PHP Error was encounteredSeverity: Notice Message: Trying to get property of non-object Filename: core/MY_Loader.php Line Number: 938
// 错误已修改好了
class Build_Tool_module extends CI_Module
{
// 在不使用HMVC的情况下是OK的
public function discount()
{
$this->load->library('marketing/Discount');
var_dump($this->discount); // null
print_r($this->discount->buildTool());
}
}
|