dev-master
9999999-devGenerate static sitemap to server statically
The Requires
The Development Requires
by César D. Rodas
v1.0.1
1.0.1.0Generate static sitemap to server statically
The Requires
The Development Requires
by César D. Rodas
Wallogit.com
2017 © Pedro PelĂĄez
Generate static sitemap to server statically
Very simple sitemap (offline) generator., (*1)
Basically it receives an array or iterator (most of the time a cursor form your database) and a callback to format the URL., (*2)
require __DIR__ . '/vendor/autoload.php';
use crodas\SitemapGenerator\SitemapGenerator;
$generator = new SitemapGenerator("https://corruptos.net/sitemap", __DIR__ . "/public_html/sitemap/");
$generator->limit(1000);
$generator = $generator->addMap(['foo', 'bar', 'xxx', 'yyy'], function($obj) {
return new Multiple([
'/1/' . $obj,
'/2/' . $obj,
'/3/' . $obj,
]);
}, 'foobar.xml');
$generator = $generator->addMap($databaseResult, function($obj) {
return $obj->url;
}, 'foobar.xml');
Generate static sitemap to server statically
Generate static sitemap to server statically