arc / events
Ariadne Component Library: W3C style events Component
3.0
2020-02-23 13:07 UTC
Requires
- php: >=7.1
- arc/base: ~3.0
Requires (Dev)
- phpunit/phpunit: 9.*
README
A flexible component library for PHP
The Ariadne Component Library is a spinoff from the Ariadne Web Application Framework and Content Management System [ http://www.ariadne-cms.org/ ]
arc/events contains
- events: W3C style event system, with a filesystem tree as the DOM
Example code:
\arc\events::cd('/foo/')->listen( 'onbeforesave', function( $event ) { return $event->preventDefault(); // don't allow saves in /foo/ }); $eventData = \arc\events::cd('/foo/bar/')->fire( 'onbeforesave' ); if ( $eventData ) { // save something, but alas - it has been prevented by a listener }