1. Go to this page and download the library: Download roolith/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/ */
roolith / event example snippets
Event::listen('login', function () {
echo 'Event user login fired! <br>';
});
Event::trigger('login');
use Roolith\Event\Event;
on login() {
return true;
}
public function logout() {
return true;
}
public function updated() {
return true;
}
}
Event::listen('login', function () {
echo 'Event user login fired! <br>';
});
$user = new User();
if($user->login()) {
Event::trigger('login');
}