嗯嗯
- 嗯嗯 2017-01-09 已签到连续签到1天,获得了5个金钱
- 嗯嗯 2017-01-07 已签到连续签到4天,获得了20个金钱
- 嗯嗯 2017-01-06 已签到连续签到3天,获得了15个金钱
666实用
- 嗯嗯 2017-01-05 已签到连续签到2天,获得了10个金钱
- 嗯嗯 回答了问题 asset怎么用的,看文档有点晕
主要是引入css,js
- 嗯嗯 回复了话题 yii怎么整合 ckeditor
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
<?phpuse yii\helpers\Html;
use yii\widgets\ActiveForm;
use dosamigos\datepicker\DatePicker;common\assets\CkeditorAsset::register($this);
<?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(); ?>
$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 /
?>web/js
$(function () {// Replace the <textarea id="editor1"> with a CKEditor // instance, using default configuration. CKEDITOR.replace('editor1');
});
- 嗯嗯 回复了话题 yii怎么整合 ckeditor
yii2 CKEDITOR上传图片怎么上传
- 嗯嗯 回复了话题 CKeditor 上传的时候文件大小限制的问题?
yii2 CKEDITOR上传图片怎么上传
yii2 CKEDITOR上传图片怎么上传