PHP

Dcat处理tinymce图片上传

是滑稽啊
2024-07-12 / 0 评论 / 8 阅读 / 正在检测是否收录...

tinymce 插件内置在dcatadmin中。
tinymce图片上传默认路径和dcatadmin图片上传保存路径不一致。
需要更改tinymce上传配置

app/Admin/bootstrap.php 文件处修改 Editor 组件样式

use Dcat\Admin\Form\Field\Editor;

Editor::resolving(function (Editor $editor) {
  $editor->options([
      'plugins' => [
          'advlist',
          'autolink',
          'link',
          'image',
          'media',
          'lists',
          'preview',
          'code',
          'help',
          'fullscreen',
          'table',
          'autoresize',
          'codesample',
          'batchUploadImage',
      ],
      'toolbar' => [
          'undo redo | preview fullscreen | styleselect | fontsizeselect bold italic underline strikethrough forecolor backcolor | link image batchUploadImage media blockquote removeformat codesample',
          'alignleft aligncenter alignright  alignjustify| indent outdent bullist numlist table subscript superscript | code',
      ],
      'min_height' => 400,
      'save_enablewhendirty' => true,
      'convert_urls' => false,
  ]);
});
0

评论

博主关闭了所有页面的评论