Blogger Information
Blog 25
fans 0
comment 1
visits 21918
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TP5博客的制作(二)模板的引入
潜轲的博客
Original
1188 people have browsed it

TP5博客的制作(二)

TP5配置文件在application\config.php,可以在模块中复制一份做特殊配置,数据库配置也一样。

模板的引入:

                1.编写控制器 application\index 模块  \controller 控制器 \具体控制器文件(首字母大写)

                 如 application\index\controller\Index.php

                    1.png

                    2.模板文件的制作

                    模板文件放在 application\index\view\index下,

                    默认为html文件。将相同的代码分离出来,放在同目录下

                    调用{include file="./common/head" /} 可方便模板修改

                    3.特殊配置的编写

                    1.png

                    即可以在视图中使用的字符串

                    在应用入口文件中写网站地址SITE_URL

                    1.png

                    这样将静态不变的css/js等文件放置在public/static/静态文件夹下,在模板中也可以使用

                    __PUBLIC__/style/lady.css

这样模板的引入完成,可能有的步骤描述不清,请多指教了。后台模板的引入方法相同就不赘述了。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post