ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
with_js_binding.php
Go to the documentation of this file.
1 <?php
2 function with_js_binding() {
3  global $DIC;
4  $f = $DIC->ui()->factory();
5  $renderer = $DIC->ui()->renderer();
6 
7  return $renderer->render(
8  $f->button()->standard("Goto ILIAS", "#")
9  ->withOnLoadCode(function($id) {
10  return
11  "$(\"#$id\").click(function() { alert(\"Clicked: $id\"); return false;});";
12  })
13  );
14 }
global $DIC
with_js_binding()