xutl / yii2-highlightjs-widget
The highlightjs extension for the Yii framework
Installs: 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:JavaScript
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is auto-updated.
Last update: 2024-11-11 03:02:48 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()