ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclBooleanRecordRepresentation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
26 public function getHTML(bool $link = true, array $options = []): string
27 {
28 $value = $this->getRecordField()->getValue();
29
30 if ($value) {
31 $icon = $this->factory->symbol()->icon()->custom(
32 ilUtil::getImagePath('standard/icon_checked.svg'),
33 $this->lng->txt("yes")
34 );
35 } else {
36 $icon = $this->factory->symbol()->icon()->custom(
37 ilUtil::getImagePath('standard/icon_unchecked.svg'),
38 $this->lng->txt("no")
39 );
40 }
41
42 return $this->renderer->render($icon);
43 }
44}
renderer()
factory()
getHTML(bool $link=true, array $options=[])
Outputs html of a certain field.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)