xutl / yii2-highlightjs-widget
The highlightjs extension for the Yii framework
Package info
github.com/xutl/yii2-highlightjs-widget
Language:JavaScript
Type:yii2-extension
pkg:composer/xutl/yii2-highlightjs-widget
2.0.1
2017-06-06 01:48 UTC
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2026-03-11 05:46:04 UTC
README
Installation
The preferred way to install this extension is through composer.
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
use xutl\highlightjs\HighlightJsAsset; HighlightJsAsset::register($this,'php'); $this->registerJs('hljs.initHighlightingOnLoad();');
use xutl\highlightjs\HighlightJs; HighlightJs::begin([ 'format'=>$model->format ]); echo Html::encode($model->content); ?> HighlightJs::end()