Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/developeruz/yii2-short-code
Using a short code in your project based on Yii2
https://github.com/developeruz/yii2-short-code
highlightjs yii2
Last synced: about 2 months ago
JSON representation
Using a short code in your project based on Yii2
- Host: GitHub
- URL: https://github.com/developeruz/yii2-short-code
- Owner: developeruz
- License: bsd-3-clause
- Created: 2014-11-28T08:03:56.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-22T07:30:11.000Z (about 10 years ago)
- Last Synced: 2024-04-03T09:20:18.356Z (9 months ago)
- Topics: highlightjs, yii2
- Language: PHP
- Size: 129 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
yii2-short-code - подсветка кода на основе Highlightjs для проектов на Yii2
===============Установка:
```bash
$ php composer.phar require developeruz/yii2-short-code "*"
```###Использование###
В action контроллера прописываем событие:
```php
Yii::$app->view->on(View::EVENT_AFTER_RENDER, ['developeruz\shortcode\Highlightjs', 'shortCode']);
```
Теперь после генерации шаблона, поведение будет заменять куски
```
[code]
some code
[/code]
```
на
```
some code
```
и подключать файлы Highlightjs. Подробнее об Highlightjs можно почитать на сайте http://highlightjs.org/