|
PHP复制代码 class Test {
var $parameter;
var $security_code;
function __construct($parameter,$security_code){
$this->parameter=$parameter;
$this->security_code=$security_code;
}
function show()
{
echo $this->parameter;
echo '<br>'.$this->security_code;
}
} 复制代码
控制器调用代码,如下:
PHP复制代码 function __construct ()
{
parent ::Controller();
$this->load->library('test',array('aa','123'));
echo $this->test->show();
} 复制代码
结果产生如下错误:
PHP复制代码 A PHP Error was encountered
Severity : Warning
Message : Missing argument 2 for Test ::__construct (), called in \Loader .php on line 927 and defined
Filename : libraries /test .php
Line Number : 8 复制代码PHP复制代码 A PHP Error was encountered
Severity: Notice
Message: Undefined variable: security_code
Filename: libraries/test.php
Line Number: 10 复制代码
传的参数一个不少,出此问题不知道何原因? |
|