Skip to content

Instantly share code, notes, and snippets.

@nelsonsar
Created March 16, 2015 18:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsonsar/97d05df3305a870015a3 to your computer and use it in GitHub Desktop.
Save nelsonsar/97d05df3305a870015a3 to your computer and use it in GitHub Desktop.
SitemapPHP decorator
<?php
class SitemapDecorator extends Sitemap
{
private $decoratedClass = null;
public function __construct(Sitemap $sitemap)
{
$this->decoratedClass = $sitemap;
}
//Here you can have an URL collection
public function addItems(array $urls)
{
foreach ($urls as $url) {
$this->decoratedClass->addItem($url);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment