|
Controller:
~
$news = $this->news_model->get_news($id); // $news 是一个对象
$news->self = $news; // 测试添加
$this->load->view('news/view', $news);
/*
$news 对象为:
stdClass Object( [id] => 2 [title] => new [slug] => new [text] => This is a test new. [new] => stdClass Object *RECURSION*)*/
~
View:
~
echo $title; // √
echo $self->id; // √
~
------------------------------------------------------------------------------------
|
|