Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
[SymfonyEventDispatcher] readme highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 8, 2017
1 parent 02ee850 commit ed215f0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/SymfonyEventDispatcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ $ composer require symplify/symfony-event-dispatcher
Register the extension in `config.neon`:

```yaml
// app/config/config.neon
# app/config/config.neon

extensions:
- Symplify\SymfonyEventDispatcher\Adapter\Nette\DI\SymfonyEventDispatcherExtension
```
Expand All @@ -29,6 +30,8 @@ extensions:
Register the Bundle to `AppKernel`:

```php
// app/AppKernel.php

class AppKernel extends Kernel
{
public function registerBundles() : array
Expand All @@ -48,7 +51,7 @@ See [short article about EventDispatcher](http://pehapkari.cz/blog/2016/12/05/sy
**This article is tested** – it will be still up-to-date with Symfony 4+.


### 1. Basically create class that implements `Symfony\Component\EventDispatcher\SubscriberInterface`:
### 1. Create class that implements `Symfony\Component\EventDispatcher\SubscriberInterface`:

```php
// app/EventSubscriber/CheckRequestEventSubscriber.php
Expand Down Expand Up @@ -84,15 +87,17 @@ final class CheckRequestEventSubscriber implements EventSubscriberInterface
**In Nette**

```yaml
// app/config/config.neon
# app/config/config.neon

services:
- App\EventSubscriber\CheckRequestEventSubscriber
```

**In Symfony**

```yaml
// app/config/service.yaml
# app/config/services.yml

services:
event_subscriber.check_request:
class: App\EventSubscriber\CheckRequestEventSubscriber
Expand Down

0 comments on commit ed215f0

Please sign in to comment.