Block fetch API and display it with Ajax

Block fetch API and display it with Ajax

by Fauzan Hibatulah Ashari -
Number of replies: 1

Hai i want to develop block that will GET data from API every time HTML event is occur, but i dont know how to do it with moodle best practice. The ENDPOINT is localhost/moodle/get_data.php i created this file manually and the code is return $DB->get_records_sql(QUERYHERE);

do i need to wrap get_data.php to Local plugin ? And use mustache to display data instead of getElementByID.innerHTML ?

GET data and display it

Thx anyway.

Average of ratings: -
In reply to Fauzan Hibatulah Ashari

Re: Block fetch API and display it with Ajax

by Tim F -
I'm curious if you got anywhere with this and also what was the end objective that you were trying to achieve.