博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
小程序使用smart模板的方法
阅读量:7070 次
发布时间:2019-06-28

本文共 916 字,大约阅读时间需要 3 分钟。

总结:如何在小程序当中使用smarty模板

1.准备

a)拥有smarty模板的api接口架构    例如:TP5b)小程序的架构    例如:微信小程序

2.接口的小程序分支

1.判断是不是小程序2.是小程序请求的情况下将原本要传输回去在小程序中进行循环渲染的数据进行传入接口自己的view层3.将view模板解析后的html代码返回给小程序

3.TP如何获取自身的view解析后的代码

通过$this->assign()进行原本的数据传输通过$return['data'] = return $this->fetch()将解析后的代码进行返回

4.小程序接收到属于html代码如何使用

在.wxml结尾的模板文件中进行:
就可以将html代码进行写入了

5.html标签兼容性

官方文档写得极为清楚:https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html节点              属性a   abbr    b   blockquote  br  code    col             span,widthcolgroup        span,widthdd  del div dl  dt  em  fieldset    h1  h2  h3  h4  h5  h6  hr  i   img             alt,src,height,widthins label   legend  li  ol              start,typep   q   span    strong  sub sup table           widthtbody   td              colspan,height,rowspan,widthtfoot   th              colspan,height,rowspan,widththead   tr  ul

转载于:https://www.cnblogs.com/hoewang/p/10257194.html

你可能感兴趣的文章
Linux下配置tomcat+apr+native应对高并发
查看>>
html5播放mp4视频代码
查看>>
孟子>正文 活动目录(Active Directory)域故障解决实例(转载)
查看>>
NoSuchMethodError: org.hibernate.SessionFactory.openSession
查看>>
textarea自动调整高宽
查看>>
python基础---面向对象高级
查看>>
vim的分屏
查看>>
windows客户端安装
查看>>
关于大型网站技术演进的思考(十八)--网站静态化处理—反向代理(10)
查看>>
Centos7怎么安装gnome桌面及远程桌面VNC
查看>>
mount挂载报错mount:you must specify the filesystem type
查看>>
yaf 模块与控制器
查看>>
Python 模块调用和global的用法
查看>>
Ubuntu 12.04 修改/etc/resolv.conf重启后还原成修改前状态解决办法
查看>>
Python—redis
查看>>
HPE牵手DDN打造整合的高性能服务器存储产品组合
查看>>
mycat分片规则之范围约定规则(auto-sharding-long)
查看>>
windows配置java环境变量
查看>>
python流程处理
查看>>
<kubernetes in action>看书笔记
查看>>