PHPackages                             dlapps/sitemap-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dlapps/sitemap-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

dlapps/sitemap-bundle
=====================

Provides simple integration for generating sitemaps in Symfony 3.2+ projects

1.0.1(9y ago)018proprietaryPHPPHP ^7.0

Since Jan 8Pushed 9y ago6 watchersCompare

[ Source](https://github.com/dlapps/sitemap-bundle)[ Packagist](https://packagist.org/packages/dlapps/sitemap-bundle)[ Docs](https://github.com/dlapps/sitemap-bundle)[ RSS](/packages/dlapps-sitemap-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Sitemap Bundle
==============

[](#sitemap-bundle)

[![Latest Version on Packagist](https://camo.githubusercontent.com/48083c4f6e4cf3e3fff2e626fdfad4623db243ef2e970bbb0e76fbc2d591fd90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646c617070732f736974656d61702d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dlapps/sitemap-bundle)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/805f5f92594740c227cc96c1941bc3c769ebb333c70421d749045ce7038656bc/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f646c617070732f736974656d61702d62756e646c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dlapps/sitemap-bundle)[![Coverage Status](https://camo.githubusercontent.com/6474e8885154bd303fcc3e068ddc24ded3ed129704220bcf1e9bd55d1ae22dc9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f646c617070732f736974656d61702d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dlapps/sitemap-bundle/code-structure)[![Quality Score](https://camo.githubusercontent.com/65beedb0ed182bad03941ffa9b0f6bd444144bbea28bc065de77ac22b9f99277/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f646c617070732f736974656d61702d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dlapps/sitemap-bundle)[![SensioLabsInsight](https://camo.githubusercontent.com/6ebae08ea15525add6c27fc67fee3f1f0a647e34e220c4cc3be98a5d35d7cf01/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39353433303465622d646233612d343263632d393834362d6261616330376665303934302f6d696e692e706e67)](https://insight.sensiolabs.com/projects/954304eb-db3a-42cc-9846-baac07fe0940)[![Total Downloads](https://camo.githubusercontent.com/45e5aa7b65146802778c2a925a8b458006e1031032957c16e585493799f59bd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646c617070732f736974656d61702d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dlapps/sitemap-bundle)

The Sitemap bundle enables development teams to quickly add support for generating sitemaps, for their PHP7 packages and projects built on Symfony 3.2+.

The bundle supports a number of customisation parameters, PSR-4 autoloading, is PSR-2 compliant and has been well tested through automated tests, as well as being used in various microservices within the Dreamlabs ecosystem.

Install
-------

[](#install)

Via Composer

```
$ composer require dreamlabs/sitemap-bundle
```

Enable the bundle in your AppKernel, present in: `app/AppKernel.php`.

```
$bundles = [
    new DL\SitemapBundle\DLSitemapBundle(),
]
```

Usage
-----

[](#usage)

In order to generate a sitemap, you need to generate an instance of sitemap definition `DL\SitemapBundle\Definition\Sitemap`. This instance can then accept the individual sitemap resources that you would like to add via the `Sitemap::addResource()` method.

In order to assist with the generation and validation of sitemap resources, the `sitemap_resource_builder` service is exposed, and can be used as in the example below:

```
$container->get('sitemap_resource_builder')
    ->withTitle($title)
    ->withAbsoluteLocation($location)
    ->withLastModified($lastModified) # \DateTime
    ->withChangeFrequency(ChangeFrequencyEnum::WEEKLY)
    ->withPriority(0.5)
    ->build();
```

The builder will automatically validate a new resource that is added to the Sitemap, and ensure that:

- All fields have been provided.
- The priority is a float between 0 and 1.
- The change frequency is a valid value.
- An absolute URL has been provided for the location.

The builder also exposes a `->withRelativeLocation($location)` method, which can be used alongside the `location_prefix` configuration parameter in order to generate absolute routes, from relative URLs. This feature is present in order to assist with possibly mismatching hostnames when proxying through an improperly configured load balancer.

Given a scenarion in which the `location_prefix` parameter is set to `https://example.com` calling `->withRelativeLocation('/article/test')` will generate the absolute URL `https://example.com//article/test`.

The `DL\SitemapBundle\Enum\ChangeFrequencyEnum` class can be used in order to define a strict change frequency. Possible values are:

- ChangeFrequencyEnum::ALWAYS
- ChangeFrequencyEnum::HOURLY
- ChangeFrequencyEnum::DAILY
- ChangeFrequencyEnum::WEEKLY
- ChangeFrequencyEnum::MONTHLY
- ChangeFrequencyEnum::YEARLY
- ChangeFrequencyEnum::NEVER

Configuration Reference
-----------------------

[](#configuration-reference)

The following configuration parameters are also available for the bundle:

```
dl_sitemap:
    # The listener prefix, can be used in order to assist with the generation of absolute URLs from relative URLs.
    location_prefix: string # https://example.com
```

Testing
-------

[](#testing)

```
$ composer test
```

PSR-2 Compatibility
-------------------

[](#psr-2-compatibility)

```
$ composer check-styles
$ composer fix-styles
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email petre \[at\] dreamlabs.ro instead of using the issue tracker.

Credits
-------

[](#credits)

- [Petre Pătrașc](https://github.com/petrepatrasc)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3460d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b7d04eec9371ca46d3214b3a20d873e59992405eb1ccd8afde316d8e84e5353?d=identicon)[petrepatrasc](/maintainers/petrepatrasc)

---

Top Contributors

[![petrepatrasc](https://avatars.githubusercontent.com/u/1115084?v=4)](https://github.com/petrepatrasc "petrepatrasc (12 commits)")

---

Tags

bundlephpphp-7sitemapsymfonysymfony3generationSitemapsitemap.xmldreamlabs

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dlapps-sitemap-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/dlapps-sitemap-bundle/health.svg)](https://phpackages.com/packages/dlapps-sitemap-bundle)
```

###  Alternatives

[samdark/sitemap

Sitemap and sitemap index builder

5521.4M43](/packages/samdark-sitemap)[marcocesarato/php-conventional-changelog

Generate changelogs and release notes from a project's commit messages and metadata and automate versioning with semver.org and conventionalcommits.org

2521.5M118](/packages/marcocesarato-php-conventional-changelog)[nystudio107/craft-seomatic

SEOmatic facilitates modern SEO best practices &amp; implementation for Craft CMS 5. It is a turnkey SEO system that is comprehensive, powerful, and flexible.

1741.5M53](/packages/nystudio107-craft-seomatic)[cebe/luya-module-sitemap

sitemap.xml module for luya CMS

116.0k](/packages/cebe-luya-module-sitemap)[kphoen/sitemap-bundle

Provides a way to create/generate a sitemap using Doctrine, etc.

2344.8k](/packages/kphoen-sitemap-bundle)[dmamontov/favicon

Class generation favicon for browsers and devices Android, Apple, Windows and display of html code. It supports a large number of settings such as margins, color, compression, three different methods of crop and screen orientation.

533.7k](/packages/dmamontov-favicon)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
