nyx-solutions/yii2-nyx-robots
Composer 安装命令:
composer require nyx-solutions/yii2-nyx-robots
包简介
Yii2 Robots.txt Generator Module
README 文档
README
Yii2 Module for automatically generating the robots.txt file.
Installation
The preferred way to install this extension is through composer.
- Either run
php composer.phar require --prefer-dist "nyx-solutions/yii2-nyx-robots" "*"
or add
"nyx-solutions/yii2-nyx-robots": "*"
to the require section of your application's composer.json file.
Usage
- Configure the
cachecomponent of your application's configuration file, for example:
'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', ], ]
- Add a new module in
modulessection of your application's configuration file, for example:
'modules' => [ 'robots' => [ 'class' => 'nyx\modules\robots\Module', 'settings' => [ 'disallowAllRobots' => false, 'allowAllRobots' => false, 'useSitemap' => true, 'sitemapFile' => '/sitemap.xml', 'robots' => [], 'allowRules' => [ 'all' => [ '/uploads' ] ], 'disallowRules' => [ 'all' => [ '/assets' ] ] ] ] ]
- Add a new rule for
urlManagerof your application's configuration file, for example:
'urlManager' => [ 'rules' => [ ['pattern' => 'robots', 'route' => 'robots/default/index', 'suffix' => '.txt'], ] ]
License
yii2-nyx-robots is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.
统计信息
- 总下载量: 88
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2022-06-01