PHP code example of ibunao / yii2-weditor

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

    

ibunao / yii2-weditor example snippets


 Problem 1
    - sebastian/version 2.0.0 hp >=5.6 -> your PHP version (5.5.12) does not satisfy that on[2.0.0].

public function actions()
{
    return [
        'weditor' => [
            'class' => 'weditor\WeditorAction',
            'config'=>[
                //上传图片配置
                //图片保存路径,及名字
                'pathFormat' => "/imagebiubiu/{yyyy}{mm}{dd}/{time}{rand:6}", 
                /* 上传保存路径,可以自定义保存路径和文件名格式 */
                /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
			    /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
			    /* {time} 会替换成时间戳 */
			    /* {yyyy} 会替换成四位年份 */
			    /* {yy} 会替换成两位年份 */
			    /* {mm} 会替换成两位月份 */
			    /* {dd} 会替换成两位日期 */
			    /* {hh} 会替换成两位小时 */
			    /* {ii} 会替换成两位分钟 */
			    /* {ss} 会替换成两位秒 */
            ]
        ],
    ];
}

<div class="row">
    <div class="col-lg-12">
         $form = ActiveForm::begin(['id' => 'login-form']);