We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3d83d9a + b311969 commit 3b64266Copy full SHA for 3b64266
src/CliMenu.php
@@ -143,6 +143,30 @@ public function addItem(MenuItemInterface $item) : void
143
}
144
145
146
+ /**
147
+ * Add multiple Items to the menu
148
+ */
149
+ public function addItems(array $items) : void
150
+ {
151
+ foreach ($items as $item) {
152
+ $this->items[] = $item;
153
+ }
154
+
155
+ if (count($this->items) === count($items)) {
156
+ $this->selectFirstItem();
157
158
159
160
161
+ * Set Items of the menu
162
163
+ public function setItems(array $items) : void
164
165
+ $this->items = $items;
166
167
168
169
170
/**
171
* Set the selected pointer to the first selectable item
172
*/
0 commit comments