PHP code example of czproject / events

1. Go to this page and download the library: Download czproject/events 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/ */

    

czproject / events example snippets

 php

$events = new CzProject\Events\Events(array(
	'click',
	'before-delete',
));

$events->addHandler('click', function () {
	// ...
});

$events->addHandler('before-delete', function (Entity\Post $post) {
	// ...
});

$events->fireEvent('click');
$events->fireEvent('before-delete', $post);