Skip to content

grenhaz/yii2-highlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Highlight wrapper for Yii2.

See: https://highlightjs.org/

Installation

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.

Basic Usage

use yii\helpers\Json;
use grenhaz\highlight\HighlightWidget;

echo HighlightWidget::widget([
    "language" => "json",
    "code" => Json::encode( Json::decode( $data ), JSON_PRETTY_PRINT )
]);

Example

Example