‪TYPO3CMS  10.4
MenuItem.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 
19 
24 {
30  protected ‪$href = '';
31 
37  protected ‪$active = false;
38 
46  public function ‪setHref(‪$href)
47  {
48  $this->href = ‪$href;
49  return $this;
50  }
51 
59  public function ‪setActive(‪$active)
60  {
61  $this->active = ‪$active;
62  return $this;
63  }
64 
70  public function ‪getHref()
71  {
72  return ‪$this->href;
73  }
74 
80  public function ‪isActive()
81  {
82  return ‪$this->active;
83  }
84 
92  public function ‪isValid(‪MenuItem $menuItem)
93  {
94  if (
95  $menuItem->‪getHref() !== ''
96  && $menuItem->‪getTitle() !== ''
97  ) {
98  return true;
99  }
100  return false;
101  }
102 }
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\setHref
‪MenuItem setHref($href)
Definition: MenuItem.php:44
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\isActive
‪bool isActive()
Definition: MenuItem.php:78
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem
Definition: MenuItem.php:24
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\isValid
‪bool isValid(MenuItem $menuItem)
Definition: MenuItem.php:90
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\setActive
‪MenuItem setActive($active)
Definition: MenuItem.php:57
‪TYPO3\CMS\Backend\Template\Components\AbstractControl\getTitle
‪string getTitle()
Definition: AbstractControl.php:64
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\getHref
‪string getHref()
Definition: MenuItem.php:68
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\$href
‪string $href
Definition: MenuItem.php:29
‪TYPO3\CMS\Backend\Template\Components\Menu
Definition: Menu.php:16
‪TYPO3\CMS\Backend\Template\Components\AbstractControl
Definition: AbstractControl.php:22
‪TYPO3\CMS\Backend\Template\Components\Menu\MenuItem\$active
‪bool $active
Definition: MenuItem.php:35