2017 © Pedro Peláez
 

library sitemap

PHP XML sitemap generation

image

thepixeldeveloper/sitemap

PHP XML sitemap generation

  • Sunday, June 24, 2018
  • by ThePixelDeveloper
  • Repository
  • 9 Watchers
  • 94 Stars
  • 305,486 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 29 Forks
  • 0 Open issues
  • 31 Versions
  • 12 % Grown

The README.md

Thepixeldeveloper\Sitemap

codecov License Latest Stable Version Total Downloads, (*1)

A tool to generate XML sitemaps. Integrates with Symfony via SitemapBundle, (*2)

Installation

``` bash composer require "thepixeldeveloper/sitemap", (*3)


## Basic Usage Generating a typical (\<urlset\>) sitemap. ``` php setLastMod($lastMod); $url->setChangeFreq($changeFreq); $url->setPriority($priority); $urlset = new Urlset(); $urlset->add($url); $driver = new XmlWriterDriver(); $urlset->accept($driver); echo $driver->output(); ``` Generating a parent (\) sitemap. ``` php setLastMod($lastMod); // Add it to a collection. $urlset = new SitemapIndex(); $urlset->add($url); $driver = new XmlWriterDriver(); $urlset->accept($driver); echo $driver->output(); ``` ## Extensions The following extensions are supported: [Image](src/Extensions/Image.php), [Link](src/Extensions/Link.php), [Mobile](src/Extensions/Mobile.php), [News](src/Extensions/News.php) and [Video](src/Extensions/Video.php). They work in the following way (taking image as an example): ``` php setLastMod($lastMod); $url->setChangeFreq($changeFreq); $url->setPriority($priority); $image = new Image('https://image-location.com'); $url->addExtension($image); ... ``` ## Advanced Usage **Processing Instructions** You can add processing instructions on the output as such. ```php addProcessingInstructions('xml-stylesheet', 'type="text/xsl" href="/path/to/xslt/main-sitemap.xsl"'); ``` Which will add before the document starts. ``` xml

Comments, (*4)

Comments are useful for information such as when the file was created., (*5)

addComment('This XML file was written on ' . $date . '. Bye!');
```

Which will render out.

``` xml


The Versions

24/06 2018

dev-master

9999999-dev

PHP XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

php xml sitemap xml-sitemap sitemap-generator sitemap-xml sitemap-php sitemap-builder

24/06 2018

5.1.3

5.1.3.0

PHP XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

php xml sitemap xml-sitemap sitemap-generator sitemap-xml sitemap-php sitemap-builder

24/06 2018

5.1.1

5.1.1.0

PHP XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

php xml sitemap xml-sitemap sitemap-generator sitemap-xml sitemap-php sitemap-builder

16/02 2018

dev-feature/code-of-conduct

dev-feature/code-of-conduct

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

xml sitemap

05/01 2018

5.1.2

5.1.2.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

xml sitemap

19/11 2017

5.1.0

5.1.0.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

xml sitemap

15/10 2017

5.0.1

5.0.1.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

xml sitemap

14/10 2017

5.0.0

5.0.0.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

xml sitemap

02/10 2017

4.5.5

4.5.5.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

xml sitemap

18/09 2017

4.5.4

4.5.4.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

xml sitemap

17/09 2017

4.5.3

4.5.3.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

xml sitemap

26/07 2017

4.5.2

4.5.2.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

xml sitemap

26/07 2017

4.5.1

4.5.1.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

xml sitemap

20/02 2017

4.5.0

4.5.0.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sitemap

03/02 2017

4.4.4

4.4.4.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

xml sitemap

02/02 2017

4.4.3

4.4.3.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

xml sitemap

15/07 2016

4.4.2

4.4.2.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

15/07 2016

4.4.1

4.4.1.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

26/04 2016

4.3.1

4.3.1.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

18/04 2016

4.3.0

4.3.0.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

08/04 2016

4.2.1

4.2.1.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

31/03 2016

4.2.0

4.2.0.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

07/01 2016

4.1.2

4.1.2.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

07/01 2016

4.1.1

4.1.1.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

07/01 2016

4.1.0

4.1.0.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

01/01 2016

4.0.2

4.0.2.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

19/12 2015

4.0.1

4.0.1.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

18/12 2015

4.0.0

4.0.0.0

XML sitemap generation

  Sources   Download

MIT

The Development Requires

xml sitemap

02/09 2014

3.0.0

3.0.0.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sitemap

18/02 2013

2.0.0

2.0.0.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sitemap

02/02 2013

1.0.0

1.0.0.0

XML sitemap generation

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

xml sitemap