<?php
//D:\LearnWebDevelop\php\thinkphp_5.0.5_full\application\index\controller\HelloWorld.php
namespace app\index\controller;
use think\Controller;
use think\Db;
class HelloWorld extends Controller
{
//http://localhost/tp5/index.php/index/hello_world/hello
//http://localhost/tp5/index.php/index/hello_world/hello/name/tom
public function hello($name = 'thinkphp')
{
$this->assign('name', $name);
return $this->fetch();
}
}
<html>
<!-- D:\LearnWebDevelop\php\thinkphp_5.0.5_full\application\index\view\hello_world\hello.html -->
<head>
<title>hello {$name}</title>
</head>
<body>
hello, {$name}!
</body>
</html>