Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Jan 30, 2016
1 parent 80e0b0b commit a8ac88f
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a8ac88f

Please sign in to comment.