How would I package an event?
Permalink
I have written 2 events into a site_events.php that are working great. I've also written a dashboard page that modifies some options and has a global on/off switch for the events.
Is there a way to auto-install these two events when I put together my package installer for distribution, or do I need to use some php code to manually move the files around on the server?
ie.
move site_events.php from /packages/packagename to /config
move eventmodel.php from /packages/packagename to /models
Is there a way to auto-install these two events when I put together my package installer for distribution, or do I need to use some php code to manually move the files around on the server?
ie.
move site_events.php from /packages/packagename to /config
move eventmodel.php from /packages/packagename to /models
You can add an on_start function to your package controller:
I guess I didn't give enough of an explanation, sorry. I want the events to be run globally, not just for a specific page/package.
Wouldn't your code only run the events on a page that is calling the package?
Wouldn't your code only run the events on a page that is calling the package?
That will work globally, give it a shot.
It does work perfectly, thank you.
So to be clear, c5 will automatically loop through every /package/packagename/controller.php on any given page load?
So to be clear, c5 will automatically loop through every /package/packagename/controller.php on any given page load?