Skip to content

Commit 95c572e

Browse files
TheSyscallnilmerg
authored andcommitted
Add a hasLinks method to Dropdown
1 parent 9edcad8 commit 95c572e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/Widget/Dropdown.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,14 @@ protected function assemble()
6060
{
6161
$this->add(Html::tag('div', ['class' => 'dropdown-menu'], $this->links));
6262
}
63+
64+
/**
65+
* Check if the dropdown element contains any links
66+
*
67+
* @return bool
68+
*/
69+
public function hasLinks(): bool
70+
{
71+
return ! empty($this->links);
72+
}
6373
}

0 commit comments

Comments
 (0)