2017 © Pedro Peláez
 

library laravel-ueditor

ueditor for laravel.

image

aweika/laravel-ueditor

ueditor for laravel.

  • Tuesday, June 27, 2017
  • by aweika
  • Repository
  • 1 Watchers
  • 0 Stars
  • 70 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

laravel-ueditor

ueditor for laravel 5.4, (*1)

============================, (*2)

使用方法:

  1. composer安装, (*3)

    composer require aweika/laravel-ueditor
    
  2. config/app.php中的providers的数组中添加, (*4)

    Aweika\LaravelUeditor\LaravelUeditorServiceProvider::class,
    

    config/app.php中的aliases的数组中添加, (*5)

    'LaravelUeditor' => Aweika\LaravelUeditor\LaravelUeditor::class,
    
  3. 执行下面命令, (*6)

    php artisan vendor:publish --provider="Aweika\LaravelUeditor\LaravelUeditorServiceProvider" --tag=first
    

    会生成配置文件config/aweika-laravel-ueditor.php 修改其中的package_path这个参数,配置ueditor的资源文件生成的目录。 此参数相对于public目录,比如默认值为aweika-laravel-ueditor,则会将编辑器的资源文件生成到public/aweika-laravel-ueditor目录中。, (*7)

  4. 执行下面命令, (*8)

    php artisan vendor:publish --provider="Aweika\LaravelUeditor\LaravelUeditorServiceProvider" --tag=second
    

    会按照上一步设置的路径生成资源文件和一个组件view。, (*9)

  5. 打开routes/web.php在适当的位置添加如下代码来设置编辑器上传相关操作所需要的路由。, (*10)

    \LaravelUeditor::routes();
    
  6. 在需要使用编辑器的view文件中调用组件,比如表单控件的名称为element。, (*11)

    • 简单的调用 php @component(\LaravelUeditor::component(), ['field'=>'element']) @endcomponent
    • 带默认值的调用 php @component(\LaravelUeditor::component(), ['field'=>'element', 'content'=>'default content']) @endcomponent
    • 带自定义脚本的调用, (*12)

      @php
          $csrf_token = csrf_token();
          $custom_script = <<<EOD
          <script type="text/javascript">
              var ue = UE.getEditor('content', {
                  initialFrameHeight:300,
                  autoHeightEnabled: false,
                  autoFloatEnabled: false,
                  wordCount:false,
                  elementPathEnabled:false,
                  toolbars: [
                          ['source', 'undo', 'redo', 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'backcolor', 'simpleupload', 'fullscreen']
                      ]
              });
      
              ue.ready(function() {
                  ue.execCommand('serverparam', '_token', '$csrf_token');
              });
          </script>
      EOD;
      @endphp
      
      @component(\LaravelUeditor::component(), ['field'=>'element', 'content'=>'default content', 'custom_script'=>$custom_script])
      @endcomponent
      

The Versions

27/06 2017

dev-master

9999999-dev

ueditor for laravel.

  Sources   Download

MIT

The Requires

 

by Avatar aweika

laravel ueditor

27/06 2017

1.0.1

1.0.1.0

ueditor for laravel.

  Sources   Download

MIT

The Requires

 

by Avatar aweika

laravel ueditor

14/04 2017

1.0.0

1.0.0.0

ueditor for laravel.

  Sources   Download

MIT

The Requires

 

by Avatar aweika

laravel ueditor