1、在php文件加代码:
load()->func('tpl');
$images = '';
2、html模板文件:
在文件顶部,即“<!DOCTYPE html>”前面加上:
{php define('MUI', true);}
<head>标记之间加入:
<!-- 上传图片 B -->
<script type="text/javascript" src="{$_W['siteroot']}app/resource/js/app/util.js"></script>
<script src="{$_W['siteroot']}app/resource/js/require.js"></script>
<script type="text/javascript" src="{$_W['siteroot']}app/resource/js/lib/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="{$_W['siteroot']}app/resource/js/lib/mui.min.js"></script>
<script type="text/javascript" src="{$_W['siteroot']}app/resource/js/app/common.js"></script>
{if defined('MUI')}
<link href="{$_W['siteroot']}app/resource/css/mui.min.css" rel="stylesheet">
{else}
<link href="{$_W['siteroot']}app/resource/css/bootstrap.min.css" rel="stylesheet">
{/if}
<link href="{$_W['siteroot']}app/resource/css/common.min.css" rel="stylesheet">
<!-- 上传图片 E -->
<body>加上传图片
<h5 class="mui-content-padded">上传图片</h5>
<div class="mui-card">
<div class="mui-input-row" style="height:100%;">
<p style="text-indent:0px;">
</p>
</div>
<div class="mui-input-row" style="height:100%;">
{php echo tpl_app_form_field_image('images', $images);}
</div>
</div>
3、表单提交,表单处理页php获取上传的图片
$threadimg = $_GPC['images']? implode(" ",$_GPC['images']):'';