UPDATE-RATE

Die Test-Installation wird aktuell zwischen 8:00 und 18:00 Uhr stündlich zur vollen Stunde aktualisiert.

Alles neu macht der Mai

ILIAS 9 ist da! Alle Infos zu den Highlights der neuen Version gibt es hier!

Documentation

Kitchen Sink documentation of style: 'Delos' of skin: 'ILIAS'

Link

Description

Purpose
Link Inputs are used to enter URLs in conjunction with a label.
Composition
Link Inputs are Input Groups consiting of a Text- and an Url Input.
Effect
Two Text Inputs are rendered, of which the first one will accept all kinds of text while the second one will be restricted to URLs.
Context
  1. The Link Input is used in UI-forms.

Rivals

Url Input
use a Url Input if users should input a URL only (without a label or similar)

Rules

Usage
  1. The URL Input MUST be used if a URL is to be entered together with an assigned label

Example 1: Base

No result yet.

<?php
 
declare(strict_types=1);
 
namespace ILIAS\UI\examples\Input\Field\Link;
 
function base()
{
    global $DIC;
    $ui = $DIC->ui()->factory();
    $renderer = $DIC->ui()->renderer();
    $request = $DIC->http()->request();
 
    $link_input = $ui->input()->field()->link("Link Input", "Enter a label and the url ")
        ->withValue(['ILIAS Homepage', "https://www.ilias.de/"]);
 
    $form = $ui->input()->container()->form()->standard("#", [$link_input]);
 
    $result = "No result yet.";
    if ($request->getMethod() == "POST") {
        $form = $form->withRequest($request);
        $data = $form->getData();
        if($data) {
            $result = $data[0];
        }
    }
 
    return
        "<pre>" . print_r($result, true) . "</pre><br />" .
        $renderer->render($form);
}
 

Relations

Parents
  1. UIComponent
  2. Input
  3. Field