企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 第三课自定义微擎独有函数 load()->func('tpl'); 生成表单函数,放到form里面 ``` <pre class="calibre14">``` <span class="token"><</span>ul class<span class="token">=</span><span class="token4">"we7-page-tab"</span><span class="token">></span> <span class="token"><</span>li class<span class="token">=</span><span class="token4">"active"</span><span class="token">></span><span class="token"><</span>a href<span class="token">=</span><span class="token4">"{php echo url('module/manage-account/setting',['m'=>'yoby_test1']);}"</span><span class="token">></span>参数设置<span class="token"><</span><span class="token">/</span>a<span class="token">></span><span class="token"><</span><span class="token">/</span>li<span class="token">></span> <span class="token"><</span><span class="token">/</span>ul<span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"content"</span><span class="token">></span> <span class="token"><</span>form action<span class="token">=</span><span class="token4">""</span> method<span class="token">=</span><span class="token4">"post"</span> class<span class="token">=</span><span class="token4">"we7-form"</span> role<span class="token">=</span><span class="token4">"form"</span> id<span class="token">=</span><span class="token4">"form1"</span><span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"panel"</span><span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"panel-body"</span><span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span><span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span><span class="token">/</span>form<span class="token">></span> <span class="token2">{</span>php <span class="token1">we7_text</span><span class="token2">(</span><span class="token4">'openid'</span><span class="token2">,</span><span class="token4">'openid'</span><span class="token2">,</span>$settings<span class="token2">[</span><span class="token4">'openid'</span><span class="token2">]</span><span class="token2">,</span><span class="token4">'openid在粉丝信息里面找'</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_texts</span><span class="token2">(</span><span class="token4">'openid'</span><span class="token2">,</span><span class="token4">'openid9'</span><span class="token2">,</span><span class="token4">'89'</span><span class="token2">,</span><span class="token4">'openid在粉丝信息里面找'</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_editor</span><span class="token2">(</span><span class="token4">'openid'</span><span class="token2">,</span><span class="token4">'openid99'</span><span class="token2">,</span><span class="token4">'99'</span><span class="token2">,</span><span class="token4">'openid在粉丝信息里面找'</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_select</span><span class="token2">(</span><span class="token4">"选择"</span><span class="token2">,</span><span class="token4">"select"</span><span class="token2">,</span><span class="token2">[</span><span class="token4">"1"</span><span class="token">=</span><span class="token">></span><span class="token4">"中国"</span><span class="token2">,</span><span class="token4">"2"</span><span class="token">=</span><span class="token">></span><span class="token4">"美国"</span><span class="token2">,</span><span class="token4">"日本"</span><span class="token2">]</span><span class="token2">,</span><span class="token4">"3"</span><span class="token2">,</span><span class="token4">"选择国家"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_image</span><span class="token2">(</span>$text<span class="token">=</span><span class="token4">"缩略图"</span><span class="token2">,</span>$name<span class="token">=</span><span class="token4">"thumb"</span><span class="token2">,</span>$value<span class="token">=</span><span class="token4">'1.jpg'</span><span class="token2">,</span>$desc<span class="token">=</span><span class="token4">'选择你的图片'</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_isshow</span><span class="token2">(</span>$text<span class="token">=</span><span class="token4">"是否显示"</span><span class="token2">,</span>$name<span class="token">=</span><span class="token4">"isshow"</span><span class="token2">,</span>$arr<span class="token">=</span><span class="token2">[</span><span class="token3">0</span><span class="token">=</span><span class="token">></span><span class="token4">'不显示'</span><span class="token2">,</span><span class="token3">1</span><span class="token">=</span><span class="token">></span><span class="token4">'显示'</span><span class="token2">]</span><span class="token2">,</span>$value<span class="token">=</span><span class="token3">0</span><span class="token2">,</span>$desc<span class="token">=</span><span class="token4">'显示选项'</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_images</span><span class="token2">(</span>$text<span class="token">=</span><span class="token4">"缩略图"</span><span class="token2">,</span>$name<span class="token">=</span><span class="token4">"tupian[]"</span><span class="token2">,</span>$value<span class="token">=</span><span class="token2">[</span><span class="token2">]</span><span class="token2">,</span>$desc<span class="token">=</span><span class="token4">'选择你的图片'</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_color</span><span class="token2">(</span><span class="token4">"选择颜色"</span><span class="token2">,</span><span class="token4">"idsx"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_date</span><span class="token2">(</span><span class="token4">"选择日期时间"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_emoji</span><span class="token2">(</span><span class="token4">"选择表情"</span><span class="token2">,</span><span class="token4">"emoji"</span><span class="token2">,</span>$value<span class="token">=</span><span class="token4">""</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_icon</span><span class="token2">(</span><span class="token4">"icon"</span><span class="token2">,</span><span class="token4">"icon"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_audio</span><span class="token2">(</span><span class="token4">"音乐上传"</span><span class="token2">,</span><span class="token4">"music"</span><span class="token2">,</span><span class="token4">''</span><span class="token2">,</span><span class="token4">"选择音乐"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_video</span><span class="token2">(</span><span class="token4">"视频上传"</span><span class="token2">,</span><span class="token4">"video"</span><span class="token2">,</span><span class="token4">''</span><span class="token2">,</span><span class="token4">"只能是mp4或flv"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_copy</span><span class="token2">(</span><span class="token4">"复制"</span><span class="token2">,</span><span class="token4">"abc"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_dates</span><span class="token2">(</span><span class="token4">"时间段"</span><span class="token2">,</span><span class="token4">"gametime"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_birthday</span><span class="token2">(</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_map</span><span class="token2">(</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_del</span><span class="token2">(</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_city</span><span class="token2">(</span><span class="token4">"省市县"</span><span class="token2">,</span><span class="token4">"ssx"</span><span class="token2">,</span><span class="token4">"湖南省"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_checkbox</span><span class="token2">(</span><span class="token4">"复选"</span><span class="token2">,</span><span class="token4">'chk'</span><span class="token2">,</span><span class="token2">[</span><span class="token4">"a"</span><span class="token">=</span><span class="token">></span><span class="token4">'男'</span><span class="token2">,</span><span class="token4">'b'</span><span class="token">=</span><span class="token">></span><span class="token4">"女"</span><span class="token2">,</span><span class="token4">"c"</span><span class="token">=</span><span class="token">></span><span class="token4">"未知"</span><span class="token2">]</span><span class="token2">,</span><span class="token4">"b"</span><span class="token2">,</span><span class="token4">"选择性别"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_radio</span><span class="token2">(</span><span class="token4">"单选"</span><span class="token2">,</span><span class="token4">'rad'</span><span class="token2">,</span><span class="token2">[</span><span class="token4">"a"</span><span class="token">=</span><span class="token">></span><span class="token4">'男'</span><span class="token2">,</span><span class="token4">'b'</span><span class="token">=</span><span class="token">></span><span class="token4">"女"</span><span class="token2">,</span><span class="token4">"c"</span><span class="token">=</span><span class="token">></span><span class="token4">"未知"</span><span class="token2">]</span><span class="token2">,</span><span class="token4">"a"</span><span class="token2">,</span><span class="token4">"选择性别"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_edit</span><span class="token2">(</span><span class="token4">"编辑"</span><span class="token2">)</span><span class="token2">}</span> <span class="token2">{</span>php <span class="token1">we7_btn</span><span class="token2">(</span><span class="token4">'保存'</span><span class="token2">)</span><span class="token2">}</span> ``` ``` 搜索表单直接用不能再form里面 ``` <pre class="calibre16">``` <span class="token2">{</span>php <span class="token1">we7_search</span><span class="token2">(</span><span class="token4">"关键字"</span><span class="token2">,</span><span class="token4">"k"</span><span class="token2">,</span><span class="token4">"中国"</span><span class="token2">,</span><span class="token4">''</span><span class="token2">)</span><span class="token2">}</span> ``` ```