Coder Social home page Coder Social logo

kindeditor's Introduction

KindEditor for Yii2

1 下载

1.1 修改项目的composer.json 在 repositories 属性中添加,如下代码,没有repositories属性,则补充添加

```
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/specialnote/kindeditor.git"
        }
    ],
```

在 require 属性中添加如下代码

```
 "specialnote/kinkeditor":"dev-master"
```

1.2 使用composer更新依赖

2 使用 2.1 在视图文件中

<?= \KindEditor\Widgets\KindEditor::widget([
  'id' => 'content',//文本域ID
  'name' => 'content',//文本域名称
  'uploadPath' => \yii\helpers\Url::to(['/dir/test/upload']),//图片上传地址
])?>

2.2 在控制器中

  public function actions(){
      return [
          'upload'=>[
              'class' => '\KindEditor\Models\KindEditor',
              'config' => [
                  'save_path' => \Yii::$app->basePath.'/web/upload/',
                  'php_url' => '/upload/',//图片访问地址前部分,url = php_url.$file_name.'.'.$ext
              ]
          ]
      ];
  }

kindeditor's People

Contributors

specialnote avatar

Watchers

James Cloos avatar  avatar

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.