quanzo/yii2-shortcode
Composer 安装命令:
composer require quanzo/yii2-shortcode
包简介
Implementation shortcodes. Module for yii2
README 文档
README
Installation
-
Copy to the folder with modules and connect autoload.php
-
Or use composer: add to the require section of the project
"quanzo/yii2-shortcode": "*"orcomposer require "quanzo/yii2-shortcode" -
Add to configuration
$config = [ 'bootstrap' => [ 'shortcode', ], 'modules' => [ 'shortcode' => [ 'class' => '\x51\yii2\modules\shortcode\Module', 'automatic' => false, // process content before output to browser 'exclude' => [ // Routes in which the use of shortcodes is prohibited. Use * and ? mask 'blocks/*', ], 'shortcodes' => [ 'url' => function ($arParams, $content = '') { // use [url path="/site/index"]main page[/url] if (!empty($arParams['path'])) { $arUrl = [ $arParams['path'] ]; foreach ($arParams as $name => $val) { if ($name != 0 || $name != 'path') { $arUrl[$name] = $val; } } $href = Url::to($arUrl); if ($content) { return Html::a($content, $href); } else { return $href; } } return ''; }, ] ], ] ];
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-08-31