【发布时间】:2019-02-01 12:50:11
【问题描述】:
无法从控制器访问变量数据到视图(模板 tpl 文件) 我有非常基本的功能
public function index() {
$message = "hello";
return $this->load->view('common/hello.tpl', $message );
}
In view template i try to get $message variable but not defined
<?php echo $message; ?>
public function index() {
$message = "hello";
return $this->load->view('common/hello.tpl', $message );
}
在视图模板 hello.tpl 我尝试获取 $message 变量但未定义
这只是一个例子。我有必须加载的模型,但现在我只需要从控制器访问视图..帮助..
【问题讨论】: