标签:ret else col 展示 save src this return 更改
//接收文件 $file = request()->file(‘image‘); //将文件移动到框架应用根目录/public/uploads/ 目录下 $info = $file->move(ROOT_PATH . ‘public‘ . DS . ‘uploads‘); //更改文件名称入库 $data[‘image‘]=$info->getSaveName(); $res=Db::table("image")->insert($data); if($res){ return $this->success("上传成功","show"); }else{ return $this->error("上传失败","file"); }
<table border="1"> <tr> <td>图片</td> </tr> {volist name="data" id="vo"} <tr> <td><img src="/uploads/{$vo.image}" width="100px" height="100px"></td> </tr> {/volist} </table>
标签:ret else col 展示 save src this return 更改
原文地址:https://www.cnblogs.com/yingyong/p/9934799.html