Hello, I am developing moodle block, it will GET data from my custom API every time javascript event is occurred. The code bellow is my API with.
// file: /var/www/html/MOODLE/custom_api.php
<?php
$sql = "SELECT * FROM mdl_*******";
return $DB->get_records_sql($sql);
..............................
I know it is not moodle best practice approchment, any suggestion to make it better ? Should I create my local plugin or create lib.php to my block folder ?
Thanks in advance