PHP code example of gavande / eventy

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

    

gavande / eventy example snippets


    'TorMorten\Eventy\EventServiceProvider',

    'Eventy' => TorMorten\Eventy\Facades\Events::class,

Eventy::action('my.hook', 'awesome');
 
$value = Eventy::filter('my.hook', 'awesome');

Eventy::addFilter('my.hook', function($what) {
    $what = 'not '. $what;
    return $what;
}, 20, 1);

Eventy::addAction('my.hook', function($what) {
    $what = Eventy::filter('my.hook', 'awesome');
    echo 'You are '. $what;
});

Eventy::addAction('my.hook', function($what) {
    echo 'You are '. $what;
}, 20, 1);