newsedit.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: xiaofeng
  5. * Date: 2018/3/6
  6. * Time: 下午5:49
  7. */
  8. use backend\assets\AppAsset;
  9. AppAsset::addScript($this,Yii::$app->request->baseUrl.'/js/newscategory.js')
  10. ?>
  11. <form class="layui-form" action="" style="margin-top: 50px">
  12. <div class="layui-form-item">
  13. <label class="layui-form-label">资讯名称</label>
  14. <div class="layui-input-block" style="width: 200px;">
  15. <input type="text" name="news_name" value="<?php echo $model['news_name']?>" required lay-verify="required" placeholder="请输入资讯名称" autocomplete="off" class="layui-input">
  16. </div>
  17. </div>
  18. <div class="layui-form-item">
  19. <label class="layui-form-label">排序</label>
  20. <div class="layui-input-block" style="width: 200px;">
  21. <input type="text" name="sort" value="<?php echo $model['sort']?>" required lay-verify="required" placeholder="请输入资讯名称" autocomplete="off" class="layui-input">
  22. </div>
  23. </div>
  24. <!-- <div class="layui-form-item">-->
  25. <!-- <label class="layui-form-label">单选框</label>-->
  26. <!-- <div class="layui-input-block">-->
  27. <!-- <input type="radio" name="recommend" value="1" title="不推荐" --><?php //if($model['recommend'] == 1) echo 'checked'?><!-->
  28. <!-- <input type="radio" name="recommend" value="2" title="推荐" --><?php //if($model['recommend'] == 2) echo 'checked'?><!-->
  29. <!-- </div>-->
  30. <!-- </div>-->
  31. <div class="layui-form-item xm_pr">
  32. <div class="layui-inline">
  33. <label class="layui-form-label">上传图片:</label>
  34. <div class="layui-inline">
  35. <div class="layui-upload">
  36. <div class="layui-upload-list lay_p_relative"> <!--低级添加 lay_p_relative-->
  37. <img class="layui-upload-img layui_magnify" name="img" src="<?php echo $model['img'] ?>" id="breviary_img" style="width:300px;height:90px;solid #ccc;">
  38. <p id="demoText"></p>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <button type="button" class="layui-btn layui-btn-primary xm_xcxqTc_button" id="test1">选择图片</button>
  44. </div>
  45. <div class="layui-form-item">
  46. <div class="layui-input-block">
  47. <input type="hidden" name="id" value="<?php echo $model['id']?>">
  48. <button class="layui-btn" lay-submit lay-filter="editnews">立即提交</button>
  49. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  50. </div>
  51. </div>
  52. </form>