PHPackages                             os/opensky-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. os/opensky-sitemap-bundle

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

os/opensky-sitemap-bundle
=========================

Adds a sitemap.xml file!

07PHP

Since May 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/abdeltiflouardi/OpenSkySitemapBundle)[ Packagist](https://packagist.org/packages/os/opensky-sitemap-bundle)[ RSS](/packages/os-opensky-sitemap-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

OpenSky SitemapBundle
=====================

[](#opensky-sitemapbundle)

This bundle will help with sitemap generation in your Symfony2 based projects.

Installation via Composer
-------------------------

[](#installation-via-composer)

Add the following to the "repositories" section of composer.json:

```
{
    "type": "vcs",
    "url": "https://github.com/opensky/SitemapBundle"
}

```

Add the following to the "require" section of composer.json:

```
"opensky/sitemap-bundle": "dev-master"

```

Adding the bundle to your kernel
--------------------------------

[](#adding-the-bundle-to-your-kernel)

To enable the sitemap bundle, add it to your kernel registerBundles() method:

```
use Symfony\Foundation\Kernel;

class MyKernel extends Kernel {
    // ...
    public function registerBundles() {
        return array(
            // ...
            new OpenSky\Bundle\SitemapBundle\OpenSkySitemapBundle(),
            // ...
        );
    }
}

```

Enabling the services
---------------------

[](#enabling-the-services)

The second step is to enable its DependencyInjection extension in your `config.yml`:

```
opensky_sitemap:
  default_lastmod:    2010-06-01
  default_changefreq: monthly
  default_priority:   0.5

```

You will need a Doctrine ODM MongoDB connection for your sitemap. This means that you have to add `DoctrineMongoDBBundle` to your Kernel and register its configuration like so:

```
doctrine_odm.mongodb:
  auto_generate_proxy_classes: true
  default_document_manager: default
  default_connection: mongodb
  cache_driver: array
  metadata_cache_driver: array
  default_database: opensky
  proxy_namespace: Proxies
  document_managers:
    default:
      connection: mongodb
  connections:
    mongodb:
      server: localhost:27017

```

Defining a Url class
--------------------

[](#defining-a-url-class)

You will need to add a URL document to your model. Most likely, you will want to save a class that looks like this to your `Document` directory:

```
