8fold/php-sitemap

A library for generating Sitemaps (XML)

Fund package maintenance!
joshbruce
8fold

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/8fold/php-sitemap

2.0.0 2022-12-13 00:24 UTC

This package is auto-updated.

Last update: 2025-09-13 07:24:44 UTC


README

Generates valid XML document and sitemap elements based on the Sitemap protocol.

Schema Version
0.9 Latest

Installation

composer require 8fold/php-sitemap

Usage

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;

Details

Designed to fit within a loop.

Other

{links or descriptions or license, versioning, and governance}