如何将变量从控制器传递到构造函数?
function __construct()
{
parent::__construct();
$info['title'] = 'No title';
$this->load->view('include/header',$info);
}
function be_cool()
{
$info['body'] = 'template/becool';
$info['title'] = 'This is the be cool title';
$this->load->view('include/template',$info);
}
function be_hot()
{
$info['body'] = 'template/behot';
$info['title'] = 'This is the be hot title';
$this->load->view('include/template',$info);
}
我试图根据控制器中定义的值更改标题。但它似乎没有工作。知道我在做什么错吗?