diff --git a/src/Widget/Dropdown.php b/src/Widget/Dropdown.php index b6eb20d1b..a449be0f4 100644 --- a/src/Widget/Dropdown.php +++ b/src/Widget/Dropdown.php @@ -60,4 +60,14 @@ protected function assemble() { $this->add(Html::tag('div', ['class' => 'dropdown-menu'], $this->links)); } + + /** + * Check if the dropdown element contains any links + * + * @return bool + */ + public function hasLinks(): bool + { + return ! empty($this->links); + } }