<p>首先打开 <strong>application/index</strong> 目录新建一个 <strong>config/template.php</strong> 文件</p>
<?php
return [
'tpl_replace_string' => [
'__CSS__'=>'/static/index/css',// 这里指向/public/static/index/css目录
'__JS__' => '/static/index/js',// 这里指向/public/static/index/js目录
'__IMG__' => '/static/index/img',// 这里指向/public/static/index/img目录
]
];
定义了三个常量 __CSS__、__JS__、__IMG__
页面引入静态资源这样使用路径即可,【静态资源一般都放置在 /public/static 目录下 】
个人博客?:点此进入(http://xueshuai.top)
PHP学习交流群?:PHP学习交流群
前端学习交流群?:前端交流群
微信公众号?:叮当Ding