同步操作将从 icefairy/webplus 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
本项目基于B4J v5.0开发
作者QQ:860668820
QQ群:227825693、244038794
项目中引用的库请从[这里下载]https://gitee.com/icefairy/b4xlib
- 模版中使用:{# $themedir #} 可以被自动替换成"/模板名称/",方便将css或者js以不同模版进行存放,安全起见view文件夹另外放置了一个目录,以免被直接从浏览器访问到,需要被直接访问的静态页面请放在public(由G.staticFolder设置,默认public)目录下即可;其中themedir和uploaddir为保留变量名,请不要在模版中除了要调用主题目录或上传目录之外的情况下使用;
- 模版中使用方法:# include "/header" #
- 其中模版后缀名可以省略,开头和结尾的(#号旁边)有个空格。
- 使用方法见下面范例中的:title
- 模版文件中使用:
<div id='header'><h1>$title$}</h1></div>
- 最终将生成:
<div id='header'><h1>网页中的标题</h1></div>
其他复杂类型的输出建议采用vuejs在前端页面进行渲染,参考test2
代码范例:
'使用方法 handler(controller)中使用:
Sub Class_Globals
Private te As WPTemplateEngine
End Sub
Public Sub Initialize
te.Initialize
End Sub Sub Handle(req As ServletRequest, resp As ServletResponse)
te.bindResponse(resp)
te.putData("headertitle","WebPlusTitle")
te.putData("title","网页中的标题")
te.putData("bodyhtml","<script>al1ert('test');</script>")
te.putData("bodytext","普通的¥文本
$3331'")
te.putData("my",CreateMap("username":"icefairy","comefrom":"China"))
te.putData("footertext","关于我们(尾部)")
te.putData("logined",1)
te.putData("isadmin",0)
te.putData("onlyif",1)
te.putData("inta",3)
te.putData("stra","aaa")
te.putData("onlyiffalse",0)
te.renderTPL("/live/live")
End Sub
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。