模板开发说明

最后更新时间:2024-09-12 14:58:01

概要:将默认模板default复制一份,然后对其进行修改优化即可,代码更新不会影响您的模板文件。


参考模板:default

模板目录结构

resources\views\template -- 模板引擎目录,存放php视图逻辑代码

resources\views\template\admin -- 管理后台

resources\views\template\index -- 官网前台

resources\views\template\user -- 用户中心

resources\views\template\panel -- 控制面板


public\views\template -- 模板静态资源目录,存放js css 图片等

public\views\template\admin -- 管理后台

public\views\template\index -- 官网前台

public\views\template\user -- 用户中心

public\views\template\panel -- 控制面板


自定义路由:模板引擎目录下“config\route.php”目录(例:resources\views\template\index\default\config\route.php),基于laravel9开发,参照laravel9中文社区文档编写https://learnku.com/docs/laravel/9.x/routing/12209

多语言支持:模板引擎目录下“lang”目录(例:resources\views\template\index\default\lang),存放语言包,官方支持通过后台自动翻译生成语言包,模板作者可以不用自行翻译。支持中文、英语、俄语、法语、意大利语、日语、韩语、越南语等多种语言。


中间件说明:

视图:view(示例:view:index.register,示例中“index.register”代表相对于"/resource/view/template"目录下的视图文件)

人机验证:robot(示例:robot)

验证码校验:captcha(示例:captcha:1,示例中“1”代表验证码用途,1=注册用户、2=登录用户、3=重置密码、4=变更手机、5=变更邮箱、6=变更主体、7=绑定微信、8=绑定QQ号、9=变更推荐人、11=重置API密码、12=合并用户、13=设置昵称

白名单:allow(示例:allow,注意:index路由默认allow放行)

附加数据:data(示例:data:article_notice{code->notice~size->6}|product_type_detail,示例中“article_notice”和“product_type_detail”代表具体附加数据,多个附加数据使用“|”分隔,“{}”对附加数据进行筛选,“~”间隔多个筛选条件。data的设置相对复杂需要时间学习)