19declare(strict_types=1);
35 DataFactory $data_factory,
43 $field_factory->text(
$lng->txt(
'ui_link_label'),
null)->withDedicatedName(
'label'),
44 $field_factory->url(
$lng->txt(
'ui_link_url'),
null)->withDedicatedName(
'url')
54 $txt_id =
'label_cannot_be_empty_if_url_is_set';
56 $is_ok =
function ($v) {
64 && is_a(
$url, URI::class)
68 $label_is_set_for_url = $this->
refinery->custom()->constraint($is_ok,
$error);
69 $this->setAdditionalTransformation($label_is_set_for_url);
80 return $this->data_factory->link(
$label ??
"",
$url);
83 $this->setAdditionalTransformation($trafo);
99 if ($this->requirement_constraint !==
null) {
100 return $this->requirement_constraint;
A Link is the often used combination of a label and an URL.
The scope of this class is split ilias-conform URI's into components.
A constraint encodes some resrtictions on values.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.