Download the PHP package roumen/sitemap without Composer
On this page you can find all versions of the php package roumen/sitemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roumen/sitemap
More information about roumen/sitemap
Files in roumen/sitemap
Package sitemap
Short Description Framework-agnostic Sitemap generator for PHP, Laravel, and Symfony.
License
Homepage https://github.com/RumenDamyanov/php-sitemap
Informations about the package sitemap
php-sitemap package
php-sitemap is a modern, framework-agnostic PHP package for generating sitemaps in XML, TXT, HTML, and Google News formats. It works seamlessly with Laravel, Symfony, or any PHP project. Features include high test coverage, robust CI, extensible adapters, and support for images, videos, translations, alternates, and Google News.
Features
- Framework-agnostic: Use in Laravel, Symfony, or any PHP project
- Multiple formats: XML, TXT, HTML, Google News, mobile
- Rich content: Supports images, videos, translations, alternates, Google News
- Modern PHP: Type-safe, extensible, and robust
- High test coverage: 100% code coverage, CI/CD ready
- Easy integration: Simple API, drop-in for controllers/routes
- Extensible: Adapters for Laravel, Symfony, and more
Installation
Usage
Laravel Example
Controller method:
Route registration:
Advanced:
Symfony Example
Controller:
Route registration:
Generic PHP Example
Advanced Features
add() vs addItem()
You can add sitemap entries using either the add()
or addItem()
methods:
add() — Simple, type-safe, one-at-a-time:
addItem() — Advanced, array-based, supports batch:
- Use
add()
for simple, explicit, one-at-a-time additions (recommended for most users). - Use
addItem()
for advanced, batch, or programmatic additions with arrays (e.g., when looping over database results).
Testing
License
MIT License