Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 710 Bytes

README.md

File metadata and controls

41 lines (26 loc) · 710 Bytes

8fold Sitemap for PHP

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}