Installation ¶
The preferred way to install this extension is through composer.
Either run
php composer.phar require skeeks/yii2-external-links "*"
or add
"skeeks/yii2-external-links": "*"
Usage ¶
//App config
[
'bootstrap' => ['externalLinks'],
'components' =>
[
//....
'externalLinks' =>
[
'class' => 'skeeks\yii2\externalLinks\ExternalLinksComponent',
],
//....
],
'modules' =>
[
//....
'externallinks' =>
[
'class' => 'skeeks\yii2\externalLinks\ExternalLinksModule',
],
//....
]
]
//App config
[
'bootstrap' => ['externalLinks'],
'components' =>
[
//....
'externalLinks' =>
[
'class' => 'skeeks\yii2\externalLinks\ExternalLinksComponent',
//Additional
'enabled' => true,
'noReplaceLocalDomain' => true,
'backendRoute' => '/externallinks/redirect/redirect',
'backendRouteParam' => 'url',
'enabledB64Encode' => true,
'noReplaceLinksOnDomains' => [
'site1.ru',
'www.site1.ru',
'site2.ru',
],
],
'urlManager' =>
[
'rules' =>
[
//Rewriting the standard route
//And add robots.txt Disallow: /~*
'~skeeks-redirect' => '/externallinks/redirect/redirect',
]
]
//....
],
'modules' =>
[
//....
'externallinks' =>
[
'class' => 'skeeks\yii2\externalLinks\ExternalLinksModule',
],
//....
]
]
Resources ¶
- GitHub
- Packagist
- Статья (rus) — Статья на русском
- Demo 1 — In the demo, see the source code
SkeekS CMS (Yii2) — quickly, easily and effectively!
skeeks.com | cms.skeeks.com
https://www.yiiframework.com/extension/skeeks/yii2-external-links — actual
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.