PHP code example of m-adamski / symfony-sitemap-bundle

1. Go to this page and download the library: Download m-adamski/symfony-sitemap-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

m-adamski / symfony-sitemap-bundle example snippets




namespace App\Model;

use Adamski\Symfony\SitemapBundle\Model\SitemapGeneratorInterface;

class SitemapGenerator implements SitemapGeneratorInterface {

    public function generateCity(): array {
        return [
            ["cityName" => "New York"],
            ["cityName" => "Oslo"],
            ["cityName" => "Warsaw"]
        ];
    }
}
yaml
index:
    path: /
    methods: [ GET ]
    controller: App\Controller\DefaultController::index
    defaults:
        _sitemap:
            priority: 1.00
            change_frequency: 'monthly'
            last_modification: '2021-01-01 12:00:00'