PHP code example of aprsoft / yii2-baidu-ueditor

1. Go to this page and download the library: Download aprsoft/yii2-baidu-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/ */

    

aprsoft / yii2-baidu-ueditor example snippets


<?= \AprSoft\UEditor\UEditor::widget(); 

<?= $form->field($model, 'body')->widget(\AprSoft\UEditor\UEditor::className()) 
    


public function actions()
{
    return [
        'upload' => [
            'class' => 'AprSoft\UEditor\UEditorAction',
            'config' => [
                "imageUrlPrefix"  => "http://www.baidu.com",//图片访问路径前缀
                "imagePathFormat" => "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", //上传保存路径
                "imageRoot" => Yii::getAlias("@webroot"),
            ],
        ]
    ];
}