Skip to content

maks757/yii2-seo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii-seo

Yii framework seo optimization module

yii migrate --migrationPath=@vendor/maks757/yii2-seo/migrations

ActiveRecord config behaviors

public function behaviors()
{
    return [
        'seo_data' => [
            'class' => 'maks757\seo\behaviors\SeoDataBehavior',
            'generation_field' => 'title'
        ],
        //...
    ];
}

add rules

public function rules()
{
    return [
        //...
        [['seoUrl', 'seoTitle',], 'string', 'max' => 255],
        [['seoKeywords',], 'string', 'max' => 512],
        [['seoDescription',], 'string', 'max' => 1024],
    ];
}

you can add properties

/**
 * @property string $seoUrl
 * @property string $seoTitle
 * @property string $seoKeywords
 * @property string $seoDescriptin
 */

and add input to form

<?= $form->field($model, 'seoUrl')->textInput() ?>
<?= $form->field($model, 'seoTitle')->textInput() ?>
<?= $form->field($model, 'seoDescription')->textarea() ?>
<?= $form->field($model, 'seoKeywords')->textarea() ?>

About

Yii framework seo optimization module

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%