sheillendra/yii2-embed-script
Composer 安装命令:
composer require sheillendra/yii2-embed-script
包简介
Yii2 Embed Script
关键字:
README 文档
README
yii2 embed custom script or 3rd party like google tracking and seo or other
Quick start
Config
...
'components'=>[
...
'embedScript'=>[
'class'=>'sheillendra\embedscript\Collection',
'services'=>[
'googleAnalytics'=>[
'class'=>'sheillendra\embedscript\services\GoogleAnalytics',
'trackerId'=>'UA-XXXXXXXX-X',
]
]
]
...
]
...
trick for local config, use NotActive for service class I'm not yet found best way without a condition (if).
...
'components'=>[
...
'embedScript'=>[
'class'=>'sheillendra\embedscript\Collection',
'services'=>[
'googleAnalytics'=>[
'class'=>'sheillendra\embedscript\services\NotActive'
]
]
]
...
]
...
using as widget in view / layout
<?php use sheillendra\embedscript\widgets\EmbedScript ?>
<?php EmbedScript::widget();?>
It can also be used as a bootstrap module so as not to bother applying widget in any layout or view.
#config
...
'bootstrap' => ['log','embedscript'],
'modules' => [
'embedscript' => ['class'=>'sheillendra\embedscript\Module']
]
...
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-16