https://github.com/xutl/yii2-highlightjs-widget
https://github.com/xutl/yii2-highlightjs-widget
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xutl/yii2-highlightjs-widget
- Owner: xutl
- Created: 2017-01-25T09:31:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-22T02:55:49.000Z (almost 8 years ago)
- Last Synced: 2025-01-20T12:46:36.435Z (4 months ago)
- Language: JavaScript
- Size: 593 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yii2-highlightjs-asset
Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist xutl/yii2-highlightjs-asset
```or add
```
"xutl/yii2-highlightjs-asset": "~1.0.0"
```to the require section of your `composer.json` file.
Usage
-----```php
use xutl\highlightjs\HighlightJsAsset;
HighlightJsAsset::register($this,'php');
$this->registerJs('hljs.initHighlightingOnLoad();');
``````php
use xutl\highlightjs\HighlightJs;HighlightJs::begin([
'format'=>$model->format
]);
echo Html::encode($model->content); ?>
HighlightJs::end()
```