I’m looking to better organize the ton of event listeners in the Plugin boot() method. I inherited a project and there’s a lot of them. For future maintenance and code organization I’d like to move the event listeners related to Rainlab Blog into a separate file.
As a test I created a file, /plugins/acme/myplugin/classes/extend/RainlabBlogExtend.php, and moved all extend type event listeners out of the Plugins.php file’s boot() method and into this file. I then call a static run() method on that file which instantiates itself and runs all sub methods that set up the event listeners (so in the Plugins.php boot() method I have this line : RainlabBlogExtend::run()
So my question is if this seems like it’s a good practice, and if there might be any issues setting up event listeners outside of the Plugin.php file itself.