ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Segment.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\UI\Component\Legacy\Segment as LegacySegment;
25use ILIAS\UI\Implementation\Component\ComponentHelper;
27
28class Segment implements SequenceSegment, LegacySegment
29{
30 use ComponentHelper;
31
32 protected ?array $actions = null;
33
34
35 public function __construct(
36 protected string $title,
37 protected string $content
38 ) {
39 }
40
41 public function getSegmentTitle(): string
42 {
43 return $this->title;
44 }
45
46 public function getSegmentContent(): string
47 {
48 return $this->content;
49 }
50
51 public function withSegmentActions(Button\Standard ...$actions): static
52 {
53 $clone = clone $this;
54 $clone->actions = $actions;
55 return $clone;
56 }
57
58 public function getSegmentActions(): array
59 {
60 return $this->actions ?? [];
61 }
62
63}
getSegmentActions()
Segments MAY add actions to the sequence.
Definition: Segment.php:58
getSegmentTitle()
A segment MUST provide a title.
Definition: Segment.php:41
__construct(protected string $title, protected string $content)
Definition: Segment.php:35
withSegmentActions(Button\Standard ... $actions)
Segments MAY add actions to the sequence.
Definition: Segment.php:51
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21