1. Go to this page and download the library: Download cwbit/cakephp-sitemap 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/ */
cwbit / cakephp-sitemap example snippets
# somewhere in config/bootstrap.php
Plugin::load('Sitemap', [
'routes' => true,
]);
'Sitemap' =>
'dynamic' =>
'Items' => #the name of the model to get entities for
'cachekey' => 'sitemap', # cachekey to use (e.g. from Configure::read('Cache.sitemap'))
'finders' => [ .. ], # array of model-layer finders for getting entities
'xmlTags' => # xml tags to output with each sitemap line
'loc' => 'url' # default 'url'; entity attribute name, or array, or string
'priority' => 0.5 # default 0.5; 0 to 1 priority
'lastmod' => 'updated' # default 'updated'; entity attribute giving lastmod time
'changefreq' => 'daily' # default 'daily'; always, hourly, daily, weekly, yearly, never