‪TYPO3CMS  ‪main
DropDownHeader.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
29 class ‪DropDownHeader implements ‪DropDownItemInterface, \Stringable
30 {
31  protected ?string ‪$label = null;
32 
33  public function ‪getLabel(): ?string
34  {
35  return ‪$this->label;
36  }
37 
38  public function ‪setLabel(?string ‪$label): self
39  {
40  $this->label = ‪$label;
41  return $this;
42  }
43 
44  public function ‪getType(): string
45  {
46  return static::class;
47  }
48 
49  public function ‪isValid(): bool
50  {
51  return $this->‪getLabel() !== null && trim($this->‪getLabel()) !== '';
52  }
53 
54  public function ‪render(): string
55  {
56  return '<h6 class="dropdown-header">' . htmlspecialchars(trim($this->‪getLabel())) . '</h6>';
57  }
58 
59  public function ‪__toString(): string
60  {
61  return $this->‪render();
62  }
63 }
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\getType
‪getType()
Definition: DropDownHeader.php:44
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\setLabel
‪setLabel(?string $label)
Definition: DropDownHeader.php:38
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\render
‪render()
Definition: DropDownHeader.php:54
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown
Definition: AbstractDropDownItem.php:16
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItemInterface
Definition: DropDownItemInterface.php:19
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader
Definition: DropDownHeader.php:30
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\isValid
‪isValid()
Definition: DropDownHeader.php:49
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\getLabel
‪getLabel()
Definition: DropDownHeader.php:33
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\__toString
‪__toString()
Definition: DropDownHeader.php:59
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownHeader\$label
‪string $label
Definition: DropDownHeader.php:31