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
- 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
- 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
- UIComponent
- Input
- Field