1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/doc/plugin-avatar-provider.markdown
2016-04-27 20:50:42 +02:00

32 lines
857 B
Markdown

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',
]
```