evster / sitemap-generator
There is no license information available for the latest version (1.0.0) of this package.
Library for generating a sitemap into file
1.0.0
2022-03-21 20:21 UTC
Requires
- php: >=7.4
- ext-dom: *
- ext-json: *
README
The library is developed to generate a sitemap from an input array $inputData, file extension (csv, json, xml) and path to generated sitemap.
Usage:
use Evster\SitemapGenerator\SitemapRecorder;
use Evster\SitemapGenerator\Constant\SitemapExtensionsConstants;
$inputData = [
[
'loc' => 'www.github.com/',
'lastmod' => '2020-12-14',
'priority' => 1,
'changefreq' => 'hourly',
],
];
$sitemap = new SitemapRecorder(
$inputData,
SitemapExtensionsConstants::EXTENSION_XML,
'generated/data.xml'
);
return $sitemap->createSitemap() ? 'Successfully generated.'
: 'Operation failed.';