phpのid値をmoodleのjqueryに渡す方法がわかりません。index.php と myscript.js の 2 つのファイルがあります。
index.php ファイル:
html_writer::tag('button','', array('id' => 'buttonCompile', 'data-url' => $urlbase));
myscript.js ファイル:
$(document).ready(function(){
alert($('#button').attr('id'));
});
js ファイルの「data-url」の値を表示する必要があります
pd: html_writer は、html コードを書き込むためのムードル関数です。この場合はボタン タグです。