Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/black-lamp/yii2-code-editor
Widget for Ace code editor
https://github.com/black-lamp/yii2-code-editor
black-lamp php yii-extension yii-widgets yii2
Last synced: 9 days ago
JSON representation
Widget for Ace code editor
- Host: GitHub
- URL: https://github.com/black-lamp/yii2-code-editor
- Owner: black-lamp
- License: bsd-3-clause
- Created: 2016-10-24T14:33:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-03T19:01:06.000Z (about 8 years ago)
- Last Synced: 2024-11-19T09:15:58.209Z (2 months ago)
- Topics: black-lamp, php, yii-extension, yii-widgets, yii2
- Language: PHP
- Size: 118 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Code editor for Yii2
Widget for [Ace](https://ace.c9.io) code editor[![Latest Stable Version](https://poser.pugx.org/black-lamp/yii2-text-editor/version)](https://packagist.org/packages/black-lamp/yii2-text-editor)
[![Latest Unstable Version](https://poser.pugx.org/black-lamp/yii2-text-editor/v/unstable)](//packagist.org/packages/black-lamp/yii2-text-editor)
[![License](https://poser.pugx.org/black-lamp/yii2-text-editor/license)](https://packagist.org/packages/black-lamp/yii2-text-editor)Installation
------------
#### Run command
```
composer require black-lamp/yii2-text-editor
```
or add
```json
"black-lamp/yii2-text-editor": "2.0.0"
```
to the require section of your composer.json.Using
-----
Use widget with ActiveForm
```php
$form = ActiveForm::begin();
// ...
echo $form->field($model, 'text')
->widget(bl\ace\AceWidget::className(), [
'language' => 'javascript'
]);
$form->end();
```
#### Widget configuration properties
| Option | Option | Default | Description |
|---|---|---|---|
|language|string|html|Programming language|
|theme|string|github|Code editor theme|
|enableEmmet|boolean|false|Enable emmet plugin for HTML|
|attributes|array|['style' => 'max-width: 600px; min-height: 400px;']|HTML attributes for editor container|For more information about 'language' and 'theme' configuration attributes read [Ace documentation](https://ace.c9.io/#nav=howto)