1、后台模板的js、images等路径与前台不一致,所以需要更改替换规则。
D:\wamp\www\wish\APP\Admin\Conf\config.php:
1
2
3
|
'TMPL_PARSE_STRING' =>array( '__PUBLIC__' => __ROOT__ . '/Public/Admin/' , // 更改默认的/Public 替换规则 ) |
2、把后台模板index.html复制到:D:\wamp\www\wish\APP\Admin\View\Index_index.html
并替换内容:
./
替换为:
__PUBLIC__/
3、把目录js、images、css复制到:D:\wamp\www\wish\Public\Admin\
4、D:\wamp\www\wish\APP\Admin\Controller\IndexController.class.php:
1
2
3
4
5
6
7
8
9
|
namespace Admin\Controller; use Think\Controller; class IndexController extends Controller { public function index(){ //echo C('TMPL_EXCEPTION_FILE'); //echo 'this is admin index'; $ this ->display(); } |