maks757/yii2-seo
Composer 安装命令:
composer require maks757/yii2-seo
包简介
SEO extension for the Yii framework
README 文档
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() ?>
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2017-02-21