(1)控制器设置:/app/Home/Controller/IndexController.class.php
<?php
namespace HomeController;
use ThinkController;
class IndexController extends Controller {
public function index(){
$this->name = 'thinkphp'; // 进行模板变量赋值
$this->display();
}
}
(2)首页模版:/app/Home/View/Index/index.html
<html>
<head>
<title>hello {$name}</title>
</head>
<body>
hello,{$name}!
</body>
</html>