Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
XML Sitemap Generation
PHP
branch: master

README.mdown

Sitemap - XML Sitemap Generation

Build Status

Sitemap is a tool to generate XML sitemaps quickly.

Usage


$basic = new \Sitemap\Sitemap\SitemapEntry('http://example.com/page-1');
$basic->setLastMod(time());

$collection = new \Sitemap\Collection;
$collection->addSitemap($basic);

// There's some different formatters available.
$collection->setFormatter(new \Sitemap\Formatter\XML\URLSet);
$collection->setFormatter(new \Sitemap\Formatter\XML\SitemapIndex);

$collection->output();

Output

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>http://example.com/page-1</loc>
        <lastmod>1359837115</lastmod>
    </url>
</urlset>

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>http://example.com/page-1</loc>
        <lastmod>1359837115</lastmod>
    </sitemap>
</urlset>
Something went wrong with that request. Please try again.