Git Product home page Git Product logo

laravel-wang-editor's Introduction

wangEditor for Laravel

wangEditor 基于javascript和css开发的 Web富文本编辑器, 轻量、简洁、易用、开源免费。官方网站:http://www.wangeditor.com/

Latest Stable Version Latest Unstable Version License Total Downloads

更新日志

2017-12-26 更新 wangEditor3.0.15 大版本,发布 v2.0 版本,并归档 2016-11-15 旧版本为 1.x

主要修改点:

  1. 支持多图片文件上传(包含拖曳上传);
  2. 上传的图片使用 其自身文件 md5 值作为文件名,以减少当天相同图片重复上传占用存储空间问题;
  3. wangEditor 静态资源目录变更,config/wang-editor.php 相关配置项的变更。

旧版 wangEditor (2.x版本)适配包请查阅 1.x 分支说明。

兼容版本

本扩展包经过测试,适配 Laravel 5.1 以上稳定版本(5.0 版本理论上也是可行的,但未经测试)。

安装与配置

composer.json 新增 "douyasi/laravel-wang-editor": "~2.0" 依赖,然后执行: composer update 操作。

依赖安装完毕之后,在 app.php 中添加:

'providers' => [
        'Douyasi\WangEditor\EditorServiceProvider',
],

然后,执行下面 artisan 命令,发布该扩展包配置等项。

php artisan vendor:publish --force

现在您可以访问 /laravel-wang-editor/example 路由,不出意外,您可以看到扩展包提供的示例页面。

演示视频: http://s1.ystatic.cn/v/9067ff068918189ef850da17acb1d806.mp4

编辑器图片默认会上传到 public/uploads/content 目录下;编辑器相关功能配置位于 config/wang-editor.php 文件中。

使用说明

blade 模版里面使用下面三个方法:we_css()we_js()we_field()we_config()

请注意 we_field()we_config() 第一个参数(对应下面示例中的 wangeditor ) 必须保持一致。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>wangEditor example</title>
    {!! we_css() !!}
    {!! we_js() !!}
</head>
<body>
<h2>wangEditor example</h2>
{!! we_field('wangeditor', 'content', '<p>wangEditor for Laravel</p>') !!}
{!! we_config('wangeditor') !!}
</body>
</html>

laravel-wang-editor's People

Contributors

ycrao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

laravel-wang-editor's Issues

laravel5.1中上传图片问题

在helpers.php中修改102行,

_{$editor_id}.config.uploadParams = {
        token : '{$token}'
};

为:

_{$editor_id}.config.uploadParams = {
        _token : '{$token}'
};

这样可以正常上传图片,不过也可能有别的解决办法。

适配wangEditor v3.x 版本已发布

2017-12-26 更新 wangEditor3.0.15 大版本,发布 v2.0 版本,并归档 2016-11-15 旧版本为 1.x

主要修改点:

  1. 支持多图片文件上传(包含拖曳上传);
  2. 上传的图片使用 其自身文件 md5 值作为文件名,以减少当天相同图片重复上传占用存储空间问题;
  3. wangEditor 静态资源目录变更,config/wang-editor.php 相关配置项的变更。

不支持图片粘贴

比如用截图软件把截图复制到剪贴板,不能往编辑器里面粘贴

上传路径 可配置

上传基本路径(uploads/content/),上传路径(/ yymmdd | yymm |yyyy |../)等,是不是写到 配置文件里,做成可配置比较好 ?
现在是在代码里写死的。。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.