diff --git a/src/widgets/navigation/NavBar.php b/src/widgets/navigation/NavBar.php index d681daf..8b1ce58 100644 --- a/src/widgets/navigation/NavBar.php +++ b/src/widgets/navigation/NavBar.php @@ -213,6 +213,11 @@ public function run() return implode("\n", $html); } + /** + * Initializes the side nav options. + * + * @param string $sidenavId the side nav element's HTML id attribute. + */ protected function initSidenav($sidenavId) { $this->sidenavToggleButtonOptions = ArrayHelper::merge([ @@ -246,6 +251,12 @@ protected function renderSidenav($sidenavId) ]); } + /** + * Renders the side nav toggle button. + * + * @return string the button markup. + * @throws \Exception + */ protected function renderSidenavToggleButton() { return Button::widget($this->sidenavToggleButtonOptions); diff --git a/src/widgets/navigation/SideNav.php b/src/widgets/navigation/SideNav.php index 656c25f..42ff373 100644 --- a/src/widgets/navigation/SideNav.php +++ b/src/widgets/navigation/SideNav.php @@ -66,7 +66,6 @@ class SideNav extends Nav * @var array the configuration options for the toggle button. * The toggle button is rendered by the [[Button]] widget. See the docs for all available options. * - * * @see Button|Button */ public $toggleButtonOptions = []; @@ -184,6 +183,16 @@ protected function renderItem($item) return Html::tag('li', $content, $listItemOptions); } + /** + * Renders a submenu as Collapsible in side navigation element. + * + * @param string $link the trigger link. + * @param array $items the submenu items. + * @param bool $isParentActive whether the submenu's parent list element shall get an 'active' state. + * @return string the Collapsible markup. + * + * @throws \Exception + */ protected function renderCollapsible($link, $items = [], $isParentActive = false) { $itemOptions = []; @@ -205,7 +214,13 @@ protected function renderCollapsible($link, $items = [], $isParentActive = false ]); } - protected function buildCollapsibleBody($items) + /** + * Build the needed markup for the collapsible body, i. e. the `