Closed Tiposbingo closed 6 years ago
Hello,
DataDragon implementation is currently not documented, so the only way to check how it works is to read function documentation comments directly in file.
I can briefly introduce it for you:
DataDragonAPI::initByCdn()
, this will fetch latest version of DD from DD itselfDataDragonAPI::initByRegion('eune')
, this will fetch latest version of DD from provided region (eune, euw, etc. -- make sure its lowercase)DataDragonAPI::initByVersion('8.1.1')
, this will explicitly specify requested version of DD, makes no requestDataDragonAPI::initByApi($api)
, this function requires instance of RiotAPI
and will request realm (region) object from API and use it to read current DD versionDataDragonAPI::initByRealmObject($realm)
, this function accepts realm (region) object on its own, makes no requestDataDragonAPI::getProfileIcon(50)
, this function returns instance of Html
class, which on __toString()
automatically renders itself as an <img>
tag, with all the required attributes to display the image.If you've got any further questions, feel free to ask 😺
Thank you very much 🥇
I find small issue. When you initalize the library using DataDragonAPI::initByApi($api)
and then DataDragonAPI::getProfileIcon(50)
return this link http://ddragon.leagueoflegends.com/cdn8.1.1/img/profileicon/588.png
but you need cdn/8.1.1
@Tiposbingo thanks! There was a bug, CDN link was not formed correctly when initialized by API or RealmObject. It should be fixed in cdd5e08.
@Tiposbingo, I've updated DataDragonAPI's wiki pages, feel free to check them out 😸
@dolejska-daniel thanks, I'll test it with my laravel app soon
Hi again, is there any more info about DataDragon API ? implementation, maybe some example ?
Thank you.