PHP code example of nosun / ueditor

1. Go to this page and download the library: Download nosun/ueditor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nosun / ueditor example snippets



    'extensions' => [

        'ueditor' => [

            // 如果要关掉这个扩展,设置为false
            'enable' => true,

            // 编辑器的前端配置 参考:http://fex.baidu.com/ueditor/#start-config
            'config' => [
                'initialFrameHeight' => 400, // 例如初始化高度
            ],
            // 'field_type' => '自定义名字'
        ]
    ]


$form->UEditor('content');
// options 中参数会覆盖 extensions.ueditor.config 中参数
$form->UEditor('content')->options(['initialFrameHeight' => 800]);

// 如果 extensions.ueditor.field_type 定义为 xxxEditor
// $form->xxxEditor('content');

$form->editor('content');
// options 中参数会覆盖 extensions.ueditor.config 中参数
$form->editor('content')->options(['initialFrameHeight' => 800]);

// 升级2.* 后,不改代码兼容 1.*:可以配置  extensions.ueditor.field_type 为 editor
bash
// V3.*
php artisan vendor:publish --provider=Nosun\LaravelUEditor\UEditorServiceProvider