generateXmlFiles

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.

Example

// src/EventListener/GenerateXmlFilesListener.php
namespace App\EventListener;

use Contao\CoreBundle\ServiceAnnotation\Hook;

/**
 * @Hook("generateXmlFiles")
 */
class GenerateXmlFilesListener
{
    public function __invoke(): void
    {
        // Do something …
    }
}

References