1 | <?php |
||
17 | class XmlTemplate implements Template |
||
18 | { |
||
19 | |||
20 | const TEMPLATE = <<<HTML |
||
21 | <?xml version="1.0" encoding="UTF-8"?> |
||
22 | <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" |
||
23 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||
24 | xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 |
||
25 | http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">\n{{entry}}</urlset> |
||
26 | HTML; |
||
27 | |||
28 | const ENTRY = <<<HTML |
||
29 | <url> |
||
30 | <loc>{{link}}</loc> |
||
31 | <changefreq>{{frequency}}</changefreq> |
||
32 | <priority>{{priority}}</priority> |
||
33 | </url>\n |
||
34 | HTML; |
||
35 | |||
36 | /** |
||
37 | * @param SiteMapUrlCollection $collection |
||
38 | * @return mixed|string |
||
39 | */ |
||
40 | public function map(SiteMapUrlCollection $collection) { |
||
53 | |||
54 | /** |
||
55 | * @param $key |
||
56 | * @param $value |
||
57 | * @param $template |
||
58 | * @return mixed |
||
59 | */ |
||
60 | private function replace($key, $value, $template) { |
||
63 | } |