Created
March 16, 2015 18:11
-
-
Save nelsonsar/97d05df3305a870015a3 to your computer and use it in GitHub Desktop.
SitemapPHP decorator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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