Replies: 1 comment 3 replies
-
I do not recommend it. As far as I can tell, class2.php does not look for an e_event.php file in the plugin folders directly. An e_event.php file may be called by other steps called by class2. I think a plugin's e_event.php file was intended as a way to neatly integrate your own event handlers into e107 core events. I've never used it.
Your plugin's e_module is loaded on every e107 page - front end or back end - regardless of weather or not the user is viewing a page in your plugin. It is very useful when your plugin needs to do things when a user is NOT on a page of your plugin. Most plugins shouldn't need to use e_module unless you need information that is either shared by a companion plugin or used in conjunction with sidebar menu: e_module can examine e_QUERY, fetch DB results and be used to create Globals that your plugin's pages and menus can then both use, instead of querying your DB multiple times. Since e_module is loaded all the time, many plugins with bloated e_module files can slow down your website. I typically check e_PAGE to see if the user is on a page that needs e_module scripts to run. On some custom websites I've made, I modify the e107core/templates/footer_default.php file to unset any Globals generated by the e_module file, just to be nice. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I wouldn't notice this but I use constant in e_module and there was an error if I used it e_event file (outside class).
Then I noticed that e_event file is loaded before e_module file in class2.php
So I put code into config method of event class, but result was the same.
There is this note in class2.php
// Load e_modules after all the constants, but before the themes, so they can be put to use.
But with this
e107::getEvent()->init();
are register all events before e_module.
If this is correct and planned, I can put code from e_module in e_event file directly. Correct?
And why is not e_module file example used in _blank plugin?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions