ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
with_additional_on_load_code.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
33{
34 //Loading factories
35 global $DIC;
36 $f = $DIC->ui()->factory();
37 $renderer = $DIC->ui()->renderer();
38
39 //Generating and rendering the image and modal
40 $image = $f->image()->standard(
41 "assets/ui-examples/images/Image/HeaderIconLarge.svg",
42 "Thumbnail Example"
43 )->withAction("#")
44 ->withAdditionalOnLoadCode(function ($id) {
45 return "$('#$id').click(function(e) { e.preventDefault(); alert('Image Onload Code')});";
46 });
47
48 $html = $renderer->render($image);
49
50 return $html;
51}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$renderer
global $DIC
Definition: shib_login.php:26