tp5/index.php/index/hello_world/hello/name/tom

<?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>

 

posted @ 2017-12-19 17:00  sky20080101  阅读(189)  评论(0)    收藏  举报