OpenSource CLI-App to install and handle stuff related to Web-Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
889 B

<?php
namespace App\Helpers;
/**
*
*
*
*/
class TerminalHelper
{
/**
*
* @param [type] $menu [description]
* @param [type] $messages [description]
* @param string $text [description]
* @return [type] [description]
*/
public function confirmArray($menu, $messages, $text = 'Ok', $field = NULL)
{
foreach($messages as $key => $message) {
if (is_array($message)) {
$this->confirmArray($menu, $message, $text, $key);
} else {
// reset prefix
$prefix = '';
// if field is not null, add prefix
if ($field) {
$prefix = $field.' ';
}
// adding confirm message
$menu->confirm($prefix.$message)->display($text);
}
}
}
}