‪TYPO3CMS  ‪main
DropDownItem.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 
34 {
35  protected string ‪$tag = 'a';
36 
37  public function ‪setTag(string ‪$tag): self
38  {
39  $this->tag = htmlspecialchars(trim(‪$tag));
40  return $this;
41  }
42 
43  public function ‪getTag(): string
44  {
45  return ‪$this->tag;
46  }
47 
48  public function ‪render(): string
49  {
50  return '<' . $this->‪getTag() . ' ' . $this->‪getAttributesString() . '>'
51  . ($this->‪getIcon() ? $this->‪getIcon()->render() : '')
52  . htmlspecialchars($this->‪getLabel())
53  . '</' . $this->‪getTag() . '>';
54  }
55 }
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem
Definition: AbstractDropDownItem.php:23
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItem\$tag
‪string $tag
Definition: DropDownItem.php:35
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem\getAttributesString
‪getAttributesString()
Definition: AbstractDropDownItem.php:114
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown
Definition: AbstractDropDownItem.php:16
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItem\getTag
‪getTag()
Definition: DropDownItem.php:43
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItemInterface
Definition: DropDownItemInterface.php:19
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItem\render
‪render()
Definition: DropDownItem.php:48
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItem\setTag
‪setTag(string $tag)
Definition: DropDownItem.php:37
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem\getLabel
‪getLabel()
Definition: AbstractDropDownItem.php:54
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\AbstractDropDownItem\getIcon
‪getIcon()
Definition: AbstractDropDownItem.php:42
‪TYPO3\CMS\Backend\Template\Components\Buttons\DropDown\DropDownItem
Definition: DropDownItem.php:34