nunomaduro / laravel-console-menu

🔘 Beautiful PHP CLI menus. Is a php-school/cli-menu wrapper for Laravel/Artisan Console Commands
MIT License
802 stars 40 forks source link

Add `separator` line support in options #7

Closed mikeerickson closed 6 years ago

mikeerickson commented 6 years ago

Give something like, display the hyphen as a separator

$options = ['Item1','Item2','-','Item3'];

Currently, the only way to accomplish this is to use something like str_repeat('-',80)

However, this breaks if you have set the width using setWidth (see related issue)

nunomaduro commented 6 years ago

@mikeerickson Please try on the following way:


$this->menu('Title')
         ->addOptions($optionsA)
         ->addLineBreak('-')
         ->addOptions($optionsB)
         ->open();
nunomaduro commented 6 years ago

@mikeerickson Please check if my solution also fixes https://github.com/nunomaduro/laravel-console-menu/issues/8.

nunomaduro commented 6 years ago

@mikeerickson This is still an issue?

mikeerickson commented 6 years ago

Never got around to implementing, had to rebuild tool using node :(

nunomaduro commented 6 years ago

I am sorry to ear that.😕

I gonna close this. Fell free to create an issue if you have more questions!