Commit cc30b6df authored by Daniel Król's avatar Daniel Król

Add basic usage

parent 93e632a4
......@@ -6,8 +6,52 @@
##Installation
Using [Composer](http://getcomposer.org/):
Add project depdendency using [Composer](http://getcomposer.org/):
```sh
$ composer require narrator/narrator-bundle
```
Then register bundle by adding it to `app/AppKernel.php` file
```
<?php
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new Mleko\Narrator\Bundle\NarratorBundle(),
);
// ...
}
// ...
}
```
##Configure listeners
NarratorBundle loads listeners from dependency container.
To use service as a listener you only need to add tag marking service as listener.
If you had service
```
<service class="Foo\BarBundle\UserInvitationSender">
// .. arguments, configuration
</service>
```
To use it as a listener add tag. Listener tag always have to define parameter event which should be FQCN of event it will listen to.
```
<service class="Foo\BarBundle\UserInvitationSender">
// .. arguments, configuration
<tag name="narrator.listener" event="Foo\BarBundle\UserRegistered"/>
</service>
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment