PHP code example of itstructure / yii2-sitemap-generator
1. Go to this page and download the library: Download itstructure/yii2-sitemap-generator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
itstructure / yii2-sitemap-generator example snippets
return [
'controllerMap' => [
'sitemap' => [
'class' => 'Itstructure\Sitemap\SitemapController',
'baseUrl' => 'https://example.com',
'modelsPath' => '@console/models/sitemap', // Sitemap-data models directory
'modelsNamespace' => 'console\models\sitemap', // Namespace in [[modelsPath]] files
'savePathAlias' => '@frontend/web', // Where would be placed the generated sitemap-files
'sitemapFileName' => 'sitemap.xml', // Name of main sitemap-file in [[savePathAlias]] directory
],
],
];