PHP code example of amirax / yii2-seo-tools

1. Go to this page and download the library: Download amirax/yii2-seo-tools 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/ */

    

amirax / yii2-seo-tools example snippets


'components' => [
    'seo' => [
        'class' => 'Amirax\SeoTools\Meta'
    ]
    ...
]

'bootstrap' => ['log', 'seo']

Yii::$app->seo->title = 'Page title';
Yii::$app->seo->metakeys = 'seo,yii2,extension';
Yii::$app->seo->metadesc = 'Page meta description';
Yii::$app->seo->tags['og:type'] = 'article';

Yii::$app->seo->setVar('USER_NAME', 'Amirax');
Yii::$app->seo->tags['og:title'] = 'Hello %USER_NAME%';

'errorHandler' => [
    'class' => 'Amirax\SeoTools\Redirect',
],

php composer.phar