Rewrap text and few minor typos, refs #4832
parent
48287b5a1c
commit
c4df3ec0d4
|
@ -89,7 +89,10 @@ Furthermore plugins may implement the
|
||||||
event handlers automatically registered with the `EventDispatcher` when the
|
event handlers automatically registered with the `EventDispatcher` when the
|
||||||
plugin is loaded.
|
plugin is loaded.
|
||||||
|
|
||||||
To register a method to an event, implement the method `getSubscribedEvents()` and have it return an array. The array key must be the event name ([listed here](https://getcomposer.org/doc/articles/scripts.md#event-names)) and the value is the name of the method in this class to be called.
|
To register a method to an event, implement the method `getSubscribedEvents()`
|
||||||
|
and have it return an array. The array key must be the
|
||||||
|
[event name](https://getcomposer.org/doc/articles/scripts.md#event-names)
|
||||||
|
and the value is the name of the method in this class to be called.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
public static function getSubscribedEvents()
|
public static function getSubscribedEvents()
|
||||||
|
@ -101,7 +104,11 @@ public static function getSubscribedEvents()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, the priority of an event handler is set to 0. The priorty can be changed by attaching a tuple where the first value is the method name, as before, and the second value is an integer representing the priority. Higher integers represent higher priorityes therefore, priortity 2 is called before priority 1, etc.
|
By default, the priority of an event handler is set to 0. The priorty can be
|
||||||
|
changed by attaching a tuple where the first value is the method name, as
|
||||||
|
before, and the second value is an integer representing the priority.
|
||||||
|
Higher integers represent higher priorities. Priortity 2 is called before
|
||||||
|
priority 1, etc.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
public static function getSubscribedEvents()
|
public static function getSubscribedEvents()
|
||||||
|
@ -113,7 +120,9 @@ public static function getSubscribedEvents()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If multiple methods should be called, then an array of tupples can be attached to each event. The tupples do not need to include the priority. If it is omitted, it will default to 0.
|
If multiple methods should be called, then an array of tuples can be attached
|
||||||
|
to each event. The tuples do not need to include the priority. If it is
|
||||||
|
omitted, it will default to 0.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
public static function getSubscribedEvents()
|
public static function getSubscribedEvents()
|
||||||
|
|
Loading…
Reference in New Issue