Register a callback function for the dispatch event in the Module.php-> init() method. Define the layout in module.config.php.