Phpillip automatically generates an XML sitemap of your website. The sitemap contains every URL called by the build command.
When registering a url in the sitemap, the build command looks for a Last-Modified header in the Response, if it exists it will be used as <lastmod>
tag for this entry in the sitemap.
So if you want to set a last modified tag for a custom controller, just set the Last-Modified header in your response.
Tip: If your routes are declared as content routes, Phpillip automatically set that header based on last change of your content files.
By default, all routes are registered in the sitemap.
To hide a route from the sitemap, use the method hideFromSitemap
;
<?php
$app->get('blog/feed.rss')->hideFromSitemap();
To disable the sitemap feature completely, set it to false
in the configuration:
# src/Resources/config/config.yml
sitemap: false