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 MIT
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 (PHP 8.2+)
- 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
- Quality tools: PHPStan Level 6, PSR-12, comprehensive testing
Quick Links
- ๐ Installation
- ๐ Usage Examples
- ๐งช Testing & Development
- ๐ค Contributing
- ๐ Security Policy
- ๐ Support & Funding
- ๐ License
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).
Rendering Options
The package provides multiple ways to generate sitemap output:
1. Built-in XML Renderer (Simple)
2. View Templates (Flexible)
For more control, use the included view templates or create your own:
Available view templates in src/views/
:
xml.php
- Standard XML sitemapxml-mobile.php
- Mobile-specific sitemapgoogle-news.php
- Google News sitemapsitemapindex.php
- Sitemap indextxt.php
- Plain text formathtml.php
- HTML format
Testing & Development
Running Tests
Code Quality
Manual Testing
Contributing
We welcome contributions! Please see our Contributing Guide for details on:
- Development setup
- Coding standards
- Testing requirements
- Pull request process
Security
If you discover a security vulnerability, please review our Security Policy for responsible disclosure guidelines.
Support
If you find this package helpful, consider:
- โญ Starring the repository
- ๐ Supporting development
- ๐ Reporting issues
- ๐ค Contributing improvements
License
MIT License