PHP code example of designs2 / events-cron
1. Go to this page and download the library: Download designs2/events-cron library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
designs2 / events-cron example snippets
$GLOBALS['TL_EVENTS']['cron.monthly'][] = function($event) {
// run monthly
};
$GLOBALS['TL_EVENTS']['cron.weekly'][] = function($event) {
// run weekly
};
$GLOBALS['TL_EVENTS']['cron.daily'][] = function($event) {
// run daily
};
$GLOBALS['TL_EVENTS']['cron.hourly'][] = function($event) {
// run hourly
};
// only support in Contao 3.0 or newer
$GLOBALS['TL_EVENTS']['cron.minutely'][] = function($event) {
// run minutely
};