2017 © Pedro Peláez
 

yii2-extension yii2-embed-script

Yii2 Embed Script

image

sheillendra/yii2-embed-script

Yii2 Embed Script

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

yii2-embed-script

yii2 embed custom script or 3rd party like google tracking and seo or other, (*1)

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)., (*2)

...
'components'=>[
  ...
  'embedScript'=>[
    'class'=>'sheillendra\embedscript\Collection',
    'services'=>[
      'googleAnalytics'=>[
        'class'=>'sheillendra\embedscript\services\NotActive'
      ]
    ]
  ]
  ...
]
...

using as widget in view / layout




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']
]
...

The Versions

16/03 2016

dev-master

9999999-dev

Yii2 Embed Script

  Sources   Download

MIT

yii2 yii embed script sheillendra

21/11 2014

v1.0.0-alpha

1.0.0.0-alpha

Yii2 Search Engine Optimization

  Sources   Download

MIT

user yii2 yii seo sheillendra