summaryrefslogtreecommitdiff
path: root/doc/en_US/plugin-avatar-provider.markdown
blob: 62941e5c2a80da836c6f1cb62824bd7939c6b03d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Adding a new Avatar Provider
=============================

Registration
------------

```php
$this->avatarManager->register(new CustomAvatarProvider());
```

Interface
---------

The provider must implements the interface `Kanboard\Core\User\Avatar\AvatarProviderInterface`:


| Method                        | Description                                                   |
|-------------------------------|---------------------------------------------------------------|
| `render(array $user, $size)`  | Render HTML                                                   |
| `isActive(array $user)`       | Returns a boolean if the provider is able to render something |


The `$user` argument is a dictionary that contains these keys:

```php
[
    'id' => 123,
    'username' => 'admin',
    'name' => 'Administrator',
    'email' => 'me@localhost',
]
```