‪TYPO3CMS  ‪main
FullyRenderedButton.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 {
42  protected ‪$htmlSource = '';
43 
49  public function ‪getHtmlSource()
50  {
51  return ‪$this->htmlSource;
52  }
53 
61  public function ‪setHtmlSource(‪$htmlSource)
62  {
63  $this->htmlSource = ‪$htmlSource;
64  return $this;
65  }
66 
72  public function ‪getType()
73  {
74  return static::class;
75  }
76 
82  public function ‪isValid()
83  {
84  if (
85  trim($this->‪getHtmlSource()) !== ''
86  && $this->‪getType() === self::class
87  ) {
88  return true;
89  }
90  return false;
91  }
92 
96  public function ‪__toString(): string
97  {
98  return $this->‪render();
99  }
100 
106  public function ‪render()
107  {
108  return '<span class="btn btn-sm btn-default">' . $this->‪getHtmlSource() . '</span>';
109  }
110 }
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\setHtmlSource
‪FullyRenderedButton setHtmlSource($htmlSource)
Definition: FullyRenderedButton.php:60
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\isValid
‪bool isValid()
Definition: FullyRenderedButton.php:81
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\getHtmlSource
‪string getHtmlSource()
Definition: FullyRenderedButton.php:48
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\$htmlSource
‪string $htmlSource
Definition: FullyRenderedButton.php:41
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\__toString
‪__toString()
Definition: FullyRenderedButton.php:95
‪TYPO3\CMS\Backend\Template\Components\Buttons
Definition: AbstractButton.php:16
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\render
‪string render()
Definition: FullyRenderedButton.php:105
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton
Definition: FullyRenderedButton.php:34
‪TYPO3\CMS\Backend\Template\Components\Buttons\FullyRenderedButton\getType
‪string getType()
Definition: FullyRenderedButton.php:71
‪TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface
Definition: ButtonInterface.php:22