使用layout控制模板布局
D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\Controller\UserController.class.php
<?php namespace News\Controller; use Think\Controller; class UserController extends Controller { Public function add2() { layout(true); $this->display('add2'); } }
D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\View\User\add2.html
<body> D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\View\User\add2.html </body>
D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\View\layout.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\View\layout.html</title> </head> {__CONTENT__} </html>
view-source:localhost/thinkphp323/index.php/News/User/add2
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\View\layout.html</title> </head> <body> D:\LearnWebDevelop\php\thinkphp_3.2.3_full\Application\News\View\User\add2.html </body> </html>

 
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号