riiitor/yii2-seo
YII2 的 SEO 组件
v1.0.4
2017-08-09 10:27 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-18 20:21:41 UTC
README
安装
创建迁移并应用它
yii migrate/create create_seo_table --fields=model_class:string:notNull,model_id:integer:notNull,title:string,keywords:string,description:string
向模型添加行为
'seo' => [ 'class' => \riiitor\seo\behaviors\SeoBehavior::className(), ]
向表单添加小部件
echo \riiitor\seo\widgets\SeoWidget::widget(['model' => $model]);
注册元数据
$model->registerSeo();