Git Product home page Git Product logo

Comments (6)

Tiposbingo avatar Tiposbingo commented on June 23, 2024 2

Thank you very much 🥇

from riot-api.

dolejska-daniel avatar dolejska-daniel commented on June 23, 2024

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:

  1. You need to initialize the library using one of these functions:
    • DataDragonAPI::initByCdn(), this will fetch latest version of DD from DD itself
    • DataDragonAPI::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 request
    • DataDragonAPI::initByApi($api), this function requires instance of RiotAPI and will request realm (region) object from API and use it to read current DD version
    • DataDragonAPI::initByRealmObject($realm), this function accepts realm (region) object on its own, makes no request
  2. You use static functions to get what you want!
    • DataDragonAPI::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 😺

from riot-api.

Tiposbingo avatar Tiposbingo commented on June 23, 2024

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

from riot-api.

dolejska-daniel avatar dolejska-daniel commented on June 23, 2024

@Tiposbingo thanks! There was a bug, CDN link was not formed correctly when initialized by API or RealmObject. It should be fixed in cdd5e08.

from riot-api.

dolejska-daniel avatar dolejska-daniel commented on June 23, 2024

@Tiposbingo, I've updated DataDragonAPI's wiki pages, feel free to check them out 😸

from riot-api.

Tiposbingo avatar Tiposbingo commented on June 23, 2024

@dolejska-daniel thanks, I'll test it with my laravel app soon

from riot-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.