thinkphp3.2 给public/header.html文件传值

浏览:1964 发布日期:2015/09/22 分类:求助交流
项目有使用layout布局,<include file="Public:Header" />
{__CONTENT__}
<include file="Public:Footer" />
新建了一个PublicController.class.php<?php  
namespace Home\Controller;
use Think\Controller;

class PublicController extends Controller {
    public function header(){
        $name = "Jims";
        $this -> assign('name', $name);
        $this -> display('header');
    }
}
?>
在header.html中拿不到{$name}的值

求教怎么传值到public的header.html 文件
最佳答案
评论() 相关
后面还有条评论,点击查看>>