PHP code example of kovalevsky-projects / event-dispatcher
1. Go to this page and download the library: Download kovalevsky-projects/event-dispatcher 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/ */
kovalevsky-projects / event-dispatcher example snippets
$dispatcher->bind('foo bar baz', function() {
echo 'You will see this message when foo, bar and baz events will be triggered';
});
// or with array
$dispatcher->bind(['foo', 'bar', 'baz'], function() { ... });
// or you can specify different actions for the each event
$dispatcher->bind([
'foo' => function() { ... },
'bar' => function() { ... },
'baz' => function() { ... },
]);
$dispatcher->unbind('foo bar baz');
// or
$dispatcher->unbind(['foo', 'bar', 'baz']);
// or you can remove ALL actions.
$dispatcher->unbind();
$dispatcher->has('foo');
// or you can check for the specific action
$dispatcher->has('foo', $someAction);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.