嗯嗯

嗯嗯

这家伙有点懒,还没写个性签名!

  • 财富值4305
  • 威望值70
  • 总积分5405

个人信息

  • 2017-01-09 已签到
    连续签到1天,获得了5个金钱
  • 2017-01-07 已签到
    连续签到4天,获得了20个金钱
  • 2017-01-06 已签到
    连续签到3天,获得了15个金钱
  • 2017-01-05 已签到
    连续签到2天,获得了10个金钱
  • 主要是引入css,js

  • asset/CkeditorAsset
    <?php
    namespace common\assets;

    use yii\web\AssetBundle;
    /*

    • To change this license header, choose License Headers in Project Properties.
    • To change this template file, choose Tools | Templates
    • and open the template in the editor.
      */
      class CkeditorAsset extends AssetBundle
      {
      public $sourcePath = '@vendor/almasaeed2010/adminlte/plugins/ckeditor';

      public $js = [

       'ckeditor.js',
      

      ];

      public $css = [
      ];

      public $depends = [

       '\dmstr\web\AdminLteAsset'
      

      ];
      }

    视图中引用js
    <?php

    use yii\helpers\Html;
    use yii\widgets\ActiveForm;
    use dosamigos\datepicker\DatePicker;

    common\assets\CkeditorAsset::register($this);
    $this->registerJsFile('/js/news.js',['depends'=>'common\assets\DatePickerAsset']);
    $this->registerJsFile('/js/news-editor.js',['depends'=>'common\assets\DatePickerAsset']);
    / @var $this yii\web\View /
    / @var $model backend\models\News /
    / @var $form yii\widgets\ActiveForm /
    ?>

    <?php $form = ActiveForm::begin(); ?> <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'keywords')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'typeId')->dropDownList(\yii\helpers\ArrayHelper::map($configModel['NewsType'],'id','name')); ?> <?= $form->field($model, 'seen')->textInput(['value' => '0']) ?> <?= $form->field($model, 'createTime')->textInput(['id' => 'datepicker'])?> <?= $form->field($model, 'isHot')->textInput(['value' => '0']) ?> <?= $form->field($model, 'isTop')->textInput(['value' => '0']) ?> <?= $form->field($model, 'sort')->textInput(['value' => '0']) ?> <?= $form->field($model, 'status')->textInput(['value' => '0']) ?> <?= $form->field($model, 'content')->textarea(['id' => 'editor1']) ?> <?= Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> <?php ActiveForm::end(); ?>

    web/js
    $(function () {

    // Replace the <textarea id="editor1"> with a CKEditor
    // instance, using default configuration.
    CKEDITOR.replace('editor1');
    

    });

  • yii2 CKEDITOR上传图片怎么上传

  • yii2 CKEDITOR上传图片怎么上传

  • yii2 CKEDITOR上传图片怎么上传

副总裁 等级规则
5405/10000
资料完整度
10/100
用户活跃度
0/100

Ta的关注

0

Ta的粉丝

6

Ta的访客

90