Generates valid XML document and sitemap elements based on the Sitemap protocol.
| Schema | Version |
|---|---|
| 0.9 | Latest |
composer require 8fold/php-sitemap
You have received the required metadata in an array; could be the results of a database query.
use Eigthfold\Sitemap\Sitemap;
$sitemap = Sitemap::create('http://yourdomain.com');
$items = // your array of items
foreach ($items as $item) {
$sitemap = $sitemap->addUrl(
$item->path
);
}
(string) $sitemap;Designed to fit within a loop.
{links or descriptions or license, versioning, and governance}