wbraganca/yii2-ace-widget
最新稳定版本:1.0.0
Composer 安装命令:
composer require wbraganca/yii2-ace-widget
包简介
Yii2 Ace (Ajax.org Cloud9 Editor) Widget
README 文档
README
Ace (Ajax.org Cloud9 Editor) source repository can be found here - https://github.com/ajaxorg/ace.
Original demo can be found here - http://ace.c9.io/#nav=embedding.
Installation
The preferred way to install this extension is through composer.
Either run
$ php composer.phar require "wbraganca/yii2-ace-widget" "*"
or add
"wbraganca/yii2-ace-widget": "*"
to the require section of your composer.json file.
Usage
<?php use wbraganca\AceEditor\AceEditorWidget; // For basic usage echo AceEditorWidget::widget([ 'name' => 'editor_name', 'value' => 'your text code', ]); // Ace editor with emmet $this->registerJsFile('https://cloud9ide.github.io/emmet-core/emmet.js'); echo AceEditorWidget::widget([ 'id' => 'attribute_id', 'model' => $model, 'attribute' => 'attribute_name', 'theme' => 'sqlserver', 'extensions' => [ 'emmet' ], 'aceOptions' => [ 'showPrintMargin' => false, 'minLines' => 20, 'maxLines' => 500, 'newLineMode' => 'unix' ] ]); ?>
Options
varNameAceEditor- global javascript variable (default isaceEditor).mode- code language (default isphp).theme- color scheme (default isgithub).editable- whether to display editable text input or just highlight the output (default istrue).autocompletion- whether to enable simple autocompletion functionality (only witheditable = true).aceOptions- ACE's editor options.
统计信息
- 总下载量: 15.7k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-12-19