crisu83/yii-seo
Composer 安装命令:
composer require crisu83/yii-seo
包简介
Search engine optimization for the Yii PHP framework.
README 文档
README
Search engine optimization for the Yii PHP framework.
Usage
In layout
<?php Yii::app()->controller->widget(
'vendor.crisu83.yii-seo.widgets.SeoHead',
array(
'httpEquivs' => array(
'Content-Type' => 'text/html; charset=utf-8',
'X-UA-Compatible' => 'IE=edge,chrome=1',
'Content-Language' => 'en-EN'
),
'defaultTitle' => "My default title",
'defaultDescription' => "My default description",
'defaultKeywords' => "My default keywords",
)
); ?>
In Controller
public function behaviors()
{
return array(
'seo' => array('class' => 'vendor.crisu83.yii-seo.behaviors.SeoBehavior'),
);
}
public function filters()
{
return array(
array('vendor.crisu83.yii-seo.filters.SeoFilter + view'), // apply the filter to the view-action
);
}
In view file
$this->title = [$model->title, "My cool site!"];
$this->metaDescription = "My page description";
$this->metaKeywords = "My page keywords";
统计信息
- 总下载量: 9.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2013-02-16