arc/events

Ariadne Component Library: W3C style events Component

3.0 2020-02-23 13:07 UTC

This package is auto-updated.

Last update: 2024-10-10 23:51:56 UTC


README

Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License

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
    }