ILIAS  trunk Revision v11.0_alpha-2645-g16283d3b3f8
Segment.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ILIAS\UI\Component\Legacy\Segment as LegacySegment;
27 
28 class 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
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
__construct(protected string $title, protected string $content)
Definition: Segment.php:35
getSegmentTitle()
A segment MUST provide a title.
Definition: Segment.php:41
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null