YII2 不通过composer安装Ueditor编辑器
今天用composer安装Ueditor,一直下载失败,不知道为什么,所以就手动安装了一下。记录一下安装步骤
GitHub地址 https://github.com/BigKuCha/yii2-ueditor-widget
首先下载ZIP格式的压缩包,把文件夹重命名为ueditor,并复制到common/widgets下,
修改文件夹下的ueditor.php、ueditorAction.php、ueditorAsset.php、upload.php 中的namespacen改为common\widgets\ueditor
namespace common\widgets\ueditor;
第二步、在调用的controller 文件中添加actions,比如我这里是用在ResourceController中的
<?php /**
* ResourceController implements the CRUD actions for Resource model.
*/
class ResourceController extends Controller
{
//code
//... public function actions()
{
return [
'upload' => [
'class' => 'common\widgets\ueditor\UeditorAction',
'config' => [
"imageUrlPrefix" => "",//图片访问路径前缀
"imagePathFormat" => "/upload/image/{yyyy}{mm}{dd}/{time}{rand:6}",
"imageRoot" => Yii::getAlias("@webroot"),
],
],
];
}
}
第三步、调用的地方,我这里是_form.php中
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'content')->widget('common\widgets\ueditor\Ueditor',[
'options'=>[
'initialFrameWidth' => 650,
]
]) ?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
</div>
<?php ActiveForm::end(); ?>
YII2 不通过composer安装Ueditor编辑器的更多相关文章
- yii2:不使用composer安装yii2-jui的方法
今天有一个功能需要用到autocomplete,既然用yii2开发,在这里当然使用它自带的yii2-jui中的autocomplete组件了.yii2basic版默认是没有yii2-jui组件的,需要 ...
- [moka同学笔记]使用composer 安装yii2以及遇到的问题
[一.Yii2安装过程] 使用composer安装,composer安装请参考其他博客 1.下载 Yii2 高级模板 跟普通模板一样 , 可以通过 Composer 和 github 下载 ,不过官方 ...
- drupal7 安装百度编辑器Ueditor及后续使用
参考文章:drupal7安装百度编辑器ueditor 一.下载 1.需要下载安装的模块: 1.1.wysiwyg 1.2.ueditor 1.3Libraries 下载后安装在\sites\all\m ...
- composer安装yii2
这几天准备入门yii2,但是对于一个看php不到5天的小白来说,只能说路途艰辛,不过,总算是解决了,先放一张大图 感受一下成功的喜悦...(文章最后有惊喜哦) ok,下面就描述一下安装的步骤: 1.安 ...
- composer 安装yii2 The package is not available in a stable-enough version解决办法
错误 Potential causes: - A typo in the package name - The package is not available in a stable-enough ...
- Windows下通过Composer安装Yii2
安装好大于5.4或更高版本的PHP环境并开启openssl扩展.如果是Apache服务器,加载Apache的mod_ssl模块. 下载Composer并安装. 开始->运行[或者WIN+R]-& ...
- Windows下通过Composer安装Yii2 [ 2.0 版本 ]
安装好大于5.4或更高版本的PHP环境并开启openssl扩展.如果是Apache服务器,加载Apache的mod_ssl模块. 下载Composer并安装. 开始->运行[或者WIN+R]-& ...
- Yii2.0 下使用 composer 安装七牛
最近在捣鼓一个网站,要上传图片,于是选择了七牛.由于Yii2.0框架本身并不具有七牛用来上传图片的接口,只能自己动手给Yii2.0框架安装七牛了. 首先在根目录下的 composer.json 进行配 ...
- Mac安装composer安装Yii2项目
[注释:]本人原创,如需转载请注明来源链接! 通过安装Composer方式安装Yii 如果还没有安装 Composer,你可以按 getcomposer.org 中的方法安装. 在 Linux 和 M ...
随机推荐
- Deep Transfer Network: Unsupervised Domain Adaptation
转自:http://blog.csdn.net/mao_xiao_feng/article/details/54426101 一.Domain adaptation 在开始介绍之前,首先我们需要知道D ...
- Mantis中的状态
在 Mantis中的 问题状态一共有以下几种 10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:cl ...
- 【Leetcode】【Easy】Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary ...
- how find a record import other database.
question:how find a record import other database. answer: solution one:you user insert into table_na ...
- May 19th 2017 Week 20th Friday
Good luck is another name for tenacity of purpose. 好运不过是坚持不懈的结果. To some extent, I don't agree with ...
- March 1 2017 Week 9 Wednesday
If you are serious giving up something, giving up is not serious at all. 如果你慎重地决定要放弃,那么放弃本身就没什么大不了的. ...
- 如何将一个PDF文件里的图片批量导出
假设我有下面这个PDF文件,里面有很多图片,我想把这些图片批量导出,而不是在Adobe Acrobat Reader里一张张手动拷贝: 本文介绍一种快捷做法. 用PDF-XChange Editor打 ...
- linux命令有用
uptime 命令用来输出系统任务队列信息 last 列出目前与过去登入系统的用户相关信息 free 用来显示系统内存状态 ps 相應的選項組合為ps -ef.ps aux,可以通過這些組合準確定位系 ...
- [转]Ubuntu 配置 Android 开发 环境
转自:http://blog.csdn.net/shulianghan/article/details/20855541 1. 安装 Android Studio (1) 下载Android Stud ...
- libevent将信号封装为socket通知的核心代码
#include"stdafx.h" #include"iostream" #include "algorithm" #include&qu ...