Skip to content
This repository was archived by the owner on Sep 17, 2018. It is now read-only.

Learn the API

Mario Bašić edited this page Apr 12, 2015 · 24 revisions

I'd like to show you how to use the API for each class: Sitemap, Sitemap Index, Url and UrlSet.

SitemapIndex

This is the class that you would want to use if you were creating a sitemap index.

use Laravelista\Bard\SitemapIndex;
use Sabre\Xml\Writer;

$sitemapIndex = new SitemapIndex(new Writer);

addSitemap($location, $lastModification = null)

This will add a sitemap to sitemap index. location is required and it must be a valid URL.

Sitemap

This class is only used from SitemapIndex class as a returned object from addSitemap method.

setLocation($url)

This will validate given URL and set it as sitemap location.


Clone this wiki locally