Skip to content

ilya-dev/head

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Head

Head is a micro event dispatcher for PHP.

Use

Create

$head = new \Head\Head;

// or

class MyOwnHead implements \Head\Contract {

    use \Head\Behaviour;

    // do what you want

}

Attach

$head->listen('foo', function($foo, $bar, $baz)
{
    // do something
});

// also valid:
// $head->listen('foo', 'valid_function');
// $head->listen('foo', ['SomeClass', 'someMethod');
// $head->listen('foo', [new SomeClass, 'someMethod']);
// and so on...

Fire

$head->fire('my_epic_event', ['pass', 'the', 'context']);

License

Head is licensed under the MIT license.

About

Head is a micro event dispatcher for PHP.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages