PHP code example of fanymagnet / simple-event
1. Go to this page and download the library: Download fanymagnet/simple-event 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/ */
fanymagnet / simple-event example snippets
Event::on('Event1', static function (int $i) {
echo $i . PHP_EOL;
Event::trigger('Event2', $i + 1);
});
Event::on('Event2', static function (int $i) {
echo $i . PHP_EOL;
});
Event::trigger('Event1', 1);