PHP code example of skeeks / yii2-external-links
1. Go to this page and download the library: Download skeeks/yii2-external-links library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
skeeks / yii2-external-links example snippets
//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',
],
//....
]
]
php composer.phar