Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 355 Bytes

using-a-service.md

File metadata and controls

19 lines (13 loc) · 355 Bytes

Using a Service

// get Xoops object
$xoops = Xoops::getInstance();

// get provider
$provider = $xoops->service('Avatar');

// call contract method
$response = $provider->getAvatarUrl($user);

// get value from response
$avatar = $response->getValue();

// all together
$avatar = $xoops->service('Avatar')->getAvatarUrl($user)->getValue();