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;
use Terminal42\ServiceAnnotationBundle\ServiceAnnotationInterface;

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

References