From a8ac88f34733d9f2c5fd9033ed0c241b353da8ba Mon Sep 17 00:00:00 2001 From: smetdenis Date: Sat, 30 Jan 2016 14:13:57 +0600 Subject: [PATCH] docs --- README.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a8e749..d10c49e 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,45 @@ $eManager->on('create', function ($entityId, &$warnings) { $warnings[] = "Something bad may or may not have happened.\n"; }); $warnings = []; -$eventEmitter->trigger('create', [$entityId, &$warnings]); +$eManager->trigger('create', [$entityId, &$warnings]); ``` ### Namespaces -... coming soon :) +```php +$eManager->on('item.*', function () { + // item.init + // item.save + echo "Any actions with item"; +}); + +$eManager->on('*.init', function () { + // tag.init + // item.init + echo "Init any entity"; +}); + +$eManager->on('*.save', function () { + // tag.save + // item.save + echo "Saving any entity in system"; +}); + +$eManager->on('*.save.after', function () { + // tag.save.after + // item.save.after + echo "Any entity on after save"; +}); + +$eManager->trigger('tag.init'); +$eManager->trigger('tag.save.before'); +$eManager->trigger('tag.save'); +$eManager->trigger('tag.save.after'); + +$eManager->trigger('item.init'); +$eManager->trigger('item.save.before'); +$eManager->trigger('item.save'); +$eManager->trigger('item.save.after'); +``` ### License