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'

Sortation

Description

Purpose
The Sortation Control enables the user to specify the order for the data displayed on the page.
Composition
The Sortation Control offers a list of available option in a dropdown.
Effect
Upon clicking an entry in the dropdown, the corresponding view is changed immediately and the dropdown closes.

Example 1: Base

Array
(
    [0] => ILIAS\Data\Order Object
        (
            [order:protected] => Array
                (
                    [field1] => ASC
                )

        )

)

<?php
 
declare(strict_types=1);
 
namespace ILIAS\UI\examples\Input\ViewControl\Sortation;
 
use ILIAS\Data\Order;
 
function base()
{
    global $DIC;
    $f = $DIC['ui.factory'];
    $r = $DIC['ui.renderer'];
 
    //construct with labels and options
    $sortation = $f->input()->viewControl()->sortation([
        'Field 1, ascending' => new Order('field1', 'ASC'),
        'Field 1, descending' => new Order('field1', 'DESC'),
        'Field 2, descending' => new Order('field2', 'DESC'),
 
    ]);
 
    //wrap the control in a ViewControlContainer
    $vc_container = $f->input()->container()->viewControl()->standard([$sortation])
        ->withRequest($DIC->http()->request());
 
    return $r->render([
        $f->legacy('<pre>' . print_r($vc_container->getData(), true) . '</pre>'),
        $f->divider()->horizontal(),
        $vc_container
    ]);
}
 

Relations

Parents
  1. UIComponent
  2. Input
  3. View Control