The generateXmlFiles
hook is triggered when the XML files are (re)generated e.g.
by clicking “System » Maintenance » Recreate the XML files” in the back end.
It has no parameters and does not expect a return value.
// src/EventListener/GenerateXmlFilesListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
#[AsHook('generateXmlFiles')]
class GenerateXmlFilesListener
{
public function __invoke(): void
{
// Do something …
}
}