1. Go to this page and download the library: Download tinywan/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/ */
tinywan / event example snippets
namespace extend;
use Symfony\Contracts\EventDispatcher\Event;
class LogErrorWriteEvent extends Event
{
const NAME = 'log.error.write'; // 事件名,事件的唯一标识
public $log;
public function __construct(array $log)
{
$this->log = $log;
}
public function handle()
{
return $this->log;
}
}