PHP code example of mrstroz / yii2-wavecms-metatags

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

    

mrstroz / yii2-wavecms-metatags example snippets


// Add migrationPaths to console config:
'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationPath' => [
            '@vendor/mrstroz/yii2-wavecms-metatags/migrations'  
        ],
    ],
],

// ...
class Page extends ActiveRecord
{

    public function behaviors()
    {
        return [
            // ...
            'meta_tags' => [
                'class' => MetaTagsBehavior::className()
            ],
        ];
    }

$page = Page::find()->one();
\mrstroz\wavecms\metatags\components\helpers\MetaTags::register($page->metaTags);

//or

$metaTags = \mrstroz\wavecms\metatags\models\MetaTags::find()->one();
\mrstroz\wavecms\metatags\components\helpers\MetaTags::register($metaTags);