maks757/yii2-seo

There is no license information available for the latest version (v1.1.0) of this package.

SEO extension for the Yii framework

Maintainers

Details

github.com/maks757/yii2-seo

Source

Installs: 45

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Type:yii2-extension

v1.1.0 2018-05-15 15:53 UTC

This package is not auto-updated.

Last update: 2024-11-15 23:43:41 UTC


README

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() ?>