You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -296,6 +296,33 @@ $menu = (new CliMenuBuilder)
296
296
->build();
297
297
```
298
298
299
+
If you want to use the full width of the terminal, you can grab the terminal object and ask/set it from there like so:
300
+
301
+
```php
302
+
<?php
303
+
304
+
use PhpSchool\CliMenu\Builder\CliMenuBuilder;
305
+
306
+
$menu = ($builder = new CliMenuBuilder)
307
+
->setWidth($builder->getTerminal()->getWidth())
308
+
->build();
309
+
```
310
+
311
+
If you want to use the full width of the terminal and apply a margin you will need to perform a little calculation yourself
312
+
since we use a box model like the `box-sizing: border-box;` in CSS. The example below will use the full width of the terminal plus a margin of 2 on the
0 commit comments