PHP code example of understeam / yii2-seo-toolbar

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

    

understeam / yii2-seo-toolbar example snippets


...
'bootstrap' => ['seoToolbar'],
'modules' => [
    'seoToolbar' => [
        'class' => 'understeam\seotoolbar\Module',
        'permission' => 'seo', // permission to check
        'allowedIPs' => ['*'],
    ],
],
...

Yii::$app->user->can('seo');

...
'bootstrap' => ['seoToolbar'],
'modules' => [
    'seoToolbar' => [
        'class' => 'understeam\seotoolbar\Module',
        'permission' => '@', // allow to any logged in user
        'allowedIPs' => ['*'],
    ],
],
...

...
'bootstrap' => ['seoToolbar'],
'modules' => [
    'seoToolbar' => [
        'class' => 'understeam\seotoolbar\Module',
        'permission' => null, // allow to any logged in user
        'allowedIPs' => ['127.0.0.1', '192.168.0.1'],
    ],
],
...

    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(), [
            'seo' => [
                'class' => 'understeam\seotoolbar\behaviors\SeoEntity',
                'attributes' => [
                    'name',
                    'slug',
                    'description'
                ],
            ],
        ]);
    }