Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
6 / 6 |
champlates\Navbar | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
6 / 6 |
__construct | |
100.00% |
1 / 1 |
3 | |
100.00% |
6 / 6 |
<?php | |
/** | |
* Copyright Hermann Krumrey <hermann@krumreyh.com> 2017 | |
* | |
* This file is part of champlates. | |
* | |
* champlates is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. | |
* | |
* champlates is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
* GNU General Public License for more details. | |
* | |
* You should have received a copy of the GNU General Public License | |
* along with champlates. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
namespace champlates; | |
/** | |
* Class Navbar | |
* Models a bootstrap Navbar | |
* @package champlates_widgets | |
*/ | |
class Navbar extends HtmlTemplate { | |
/** | |
* Navbar constructor. | |
* @param Dictionary $dictionary: The dictionary used to translate | |
* @param Hyperlink $title: The title of the navbar | |
* @param array $leftElements: The left elements of the navbar. | |
* @param array $rightElements: The right elements of the navbar. | |
* @param NavbarLogo|null $logo: The logo of the navbar. Can be left empty. | |
* @SuppressWarnings functionMaxParameters | |
*/ | |
public function __construct( | |
? Dictionary $dictionary, | |
Hyperlink $title, | |
array $leftElements = [], | |
array $rightElements = [], | |
? NavbarLogo $logo = null | |
) { | |
parent::__construct(__DIR__ . "/templates/navbar.html", $dictionary); | |
$this->bindParams(["TITLE" => $title->text, "LINK" => $title->link]); | |
$this->addInnerTemplate("LOGO", $logo); | |
$this->addCollectionFromArray("LEFT", $leftElements); | |
$this->addCollectionFromArray("RIGHT", $rightElements); | |
} | |
} |