PHP code example of sbs / yii2-seo

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

    

sbs / yii2-seo example snippets


'controllerMap' => [
    'migrate' => [
        'class' => MigrateController::class,
        'migrationPath' => [
            '@console/migrations',
            '@vendor/sbs/yii2-seo/src/migrations',
        ],
        //...
    ],
    //...
]

use sbs\behaviors\SeoBehavior;

function behaviors()
{
    return [
    //...
        SeoBehavior::class,
    //...
    ];
}

//...
use sbs\widgets\SeoForm;
//...

use sbs\widgets\SeoTags;
//...
SeoTags::widget(['seo' => $model->seo]);
// ...

use sbs\widgets\SeoTags;
//...
SeoTags::widget(['title' => 'title', 'keywords' => 'keyword 1, keyword 2', 'description' => 'your description']);
// ...
bash
php yii migrate/up --migrationPath=vendor/sbs/yii2-seo/src/migrations