|
自定义类:
PHP复制代码
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Useridentify {
var $p;
public function __construct ($p ='') {
// Do something with $params
echo $p;
}
}
?>
复制代码
控制器:
PHP复制代码
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Home extends CI_Controller {
public function index () {
$a = "hello";
$this->load->library('useridentify',$a);
}
}
复制代码
为什么构造函数中不能输出参数p?
|
|