Download the PHP package zhelyabuzhsky/yii2-sitemap without Composer
On this page you can find all versions of the php package zhelyabuzhsky/yii2-sitemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zhelyabuzhsky/yii2-sitemap
More information about zhelyabuzhsky/yii2-sitemap
Files in zhelyabuzhsky/yii2-sitemap
Package yii2-sitemap
Short Description A Yii2 tool to generate sitemap.xml.
License GPL-3.0
Homepage https://github.com/zhelyabuzhsky/yii2-sitemap
Informations about the package yii2-sitemap
Sitemap.xml generator for Yii2
Yii2 extension to generate sitemap files for large web-sites through Yii2 console command
Installation
The preferred way to install this extension is through composer.
or add
to the require section of your composer.json
file.
Features
- Generates multiple sitemaps (large sites)
- Creates index sitemap file
- Gzip compression of .xml files
- Disallow urls support (through regular expression array)
Configuration
1. Configure urlManager
at console config
NOTE Both params hostInfo
and baseUrl
are required for Yii2 console app.
NOTE urlManager
rules
section usually repeats your frontend urlManager
configuration, so you could merge it at console config (see https://github.com/yiisoft/yii2/issues/1578#issuecomment-66716648):
Show details
`console/main.php` `frontend/config/UrlManager.php`2. Configure Sitemap
component at console config components section
Example of using extra Sitemap
params
where
maxUrlsCountInFile
- max count of urls in one sitemap file;sitemapDirectory
- directory to place sitemap files;optionalAttributes
- list of used optional attributes;maxFileSize
- maximal file size. Zero to work without limits. So you can specify the following abbreviations k - kilobytes and m - megabytes. By default 10m.
Usage
1. Impement SitemapEntityInterface
for the models you want to use at sitemap
Show example
`common\models\Category.php`2. Create Yii2 controller for console command
3. Run console command
Testing
Set enviroment variable SERVER_NAME (e.g. https://example.com)
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Ilya Zhelyabuzhsky
- All Contributors
License
GNU General Public License, version 3. Please see License File for more information.