ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
with_additional_on_load_code.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\UI\examples\Image\Standard
;
22
32
function
with_additional_on_load_code
()
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
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
$renderer
$renderer
Definition:
build_bootstrap.php:83
ILIAS\UI\examples\Image\Standard
Definition:
base.php:21
ILIAS\UI\examples\Image\Standard\with_additional_on_load_code
with_additional_on_load_code()
Definition:
with_additional_on_load_code.php:32
Vendor\Package\$f
$f
Definition:
example_cleaned.php:49
$DIC
global $DIC
Definition:
shib_login.php:26
components
ILIAS
UI
src
examples
Image
Standard
with_additional_on_load_code.php
Generated on Sat Oct 18 2025 23:04:40 for ILIAS by
1.9.4 (using
Doxyfile
)