samdark/sitemap

Usage in Symfony 2 framework

SergeC opened this issue · 1 comments

Thanks for well coded library. I successfully installed and using this library in Symfony2 framework. Just want to share my code that can be merged into readme and useful for someone else.

// app/config/services.yml
services:
sitemap.generator:
class: samdark\sitemap\Sitemap
arguments: ["%kernel.root_dir%/../web/sitemap.xml"]

Use it as a service
$sitemap = $this->getContainer()->get('sitemap.generator');

Won't add it since it's general purpose library, not a framework-specific one.