18 declare(strict_types=1);
31 class Link extends Group implements C\Input\Field\Link
53 $txt_id =
'label_cannot_be_empty_if_url_is_set';
55 $is_ok =
function ($v) {
63 && is_a(
$url, URI::class)
67 $label_is_set_for_url = $this->
refinery->custom()->constraint($is_ok,
$error);
68 $this->setAdditionalTransformation($label_is_set_for_url);
74 $trafo = $this->
refinery->custom()->transformation(
function ($v): ?\
ILIAS\Data\
Link {
79 return $this->data_factory->link(
$label ??
"",
$url);
82 $this->setAdditionalTransformation($trafo);
98 if ($this->requirement_constraint !== null) {
99 return $this->requirement_constraint;
A Link is the often used combination of a label and an URL.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A constraint encodes some resrtictions on values.
__construct(Container $dic, ilPlugin $plugin)
Refinery Factory $refinery