The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist grenhaz/yii2-highlight
or add
"grenhaz/yii2-highlight": "~1.0.0"
to the require
section of your composer.json.
use yii\helpers\Json;
use grenhaz\highlight\HighlightWidget;
echo HighlightWidget::widget([
"language" => "json",
"code" => Json::encode( Json::decode( $data ), JSON_PRETTY_PRINT )
]);