enchikiben/yii2-sitemap
最新稳定版本:0.0.2
Composer 安装命令:
composer require enchikiben/yii2-sitemap
包简介
Yii2 generation Sitemap XML
README 文档
README
Installation
The preferred way to install this extension is through composer.
php composer.phar require --prefer-dist "enchikiben/yii2-sitemap" "*"
or
"enchikiben/yii2-sitemap" : "*"
Configure
'modules' => [ 'sitemap' => [ 'class' => 'enchikiben\sitemap\Sitemap', 'controllerDirAlias' => '@frontend/controllers' ], ],
Add a new rule for urlManager of your application's configuration file, for example:
'urlManager' => [ 'rules' => [ ['pattern' => 'sitemap', 'route' => 'sitemap/default/index', 'suffix' => '.xml'], ], ],
Use
class SiteController extends Base { /** * @sitemap priority=1 */ public function actionIndex() { } /** * @sitemap priority=0.8 */ public function actionConfidentiality() { } }
or
class NewsController extends Base { /** * @sitemap priority=0.5 changefreq=monthly route=['/news/view','id'=>$model->id] model=common\models\News condition=['status'=>1] */ public function actionView($id) { } }
统计信息
- 总下载量: 9.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-19