本文整理匯總了PHP中Symfony\Component\Console\Helper\TableStyle::setVerticalBorderChar方法的典型用法代碼示例。如果您正苦於以下問題:PHP TableStyle::setVerticalBorderChar方法的具體用法?PHP TableStyle::setVerticalBorderChar怎麽用?PHP TableStyle::setVerticalBorderChar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\Console\Helper\TableStyle
的用法示例。
在下文中一共展示了TableStyle::setVerticalBorderChar方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: declareWinner
private function declareWinner(PokerGame $pokerGame)
{
$style = new TableStyle();
$style->setVerticalBorderChar('<fg=red;bg=black>|</>')->setHorizontalBorderChar('<fg=red;bg=black>-</>');
$winningHand = $pokerGame->getWinner();
$table = new Table($this->output);
$table->setRows([$winningHand]);
$table->render();
}
示例2: displayErrors
/**
* Display validation errors.
*
* @param Validator $validator The json-schema validator.
* @param OutputInterface $output An OutputInterface instance.
*/
public static function displayErrors(Validator $validator, OutputInterface $output)
{
$table = new Table($output);
$style = new TableStyle();
$style->setCellHeaderFormat('<error>%s</error>');
$style->setHorizontalBorderChar(' ');
$style->setVerticalBorderChar(' ');
$style->setCrossingChar(' ');
$table->setHeaders(['Property', 'Error']);
$table->setRows($validator->getErrors());
$table->setStyle($style);
$table->render();
}
示例3: getTable
/**
* Get a Table instance.
*
* Falls back to legacy TableHelper.
*
* @return Table|TableHelper
*/
protected function getTable(OutputInterface $output)
{
if (!class_exists('Symfony\\Component\\Console\\Helper\\Table')) {
return $this->getTableHelper();
}
$style = new TableStyle();
$style->setVerticalBorderChar(' ')->setHorizontalBorderChar('')->setCrossingChar('');
$table = new Table($output);
return $table->setRows(array())->setStyle($style);
}
示例4: table
/**
* @param string[] $rows
* @param string[] $headers
*/
public function table(array $rows, array $headers = null)
{
$rows = array_map(function ($value) {
if (!is_array($value)) {
return $value;
}
$header = array_shift($value);
array_unshift($value, sprintf('<fg=blue>%s</>', $header));
return $value;
}, $rows);
$style = new TableStyle();
$style->setVerticalBorderChar('<fg=blue>|</>');
$style->setHorizontalBorderChar('<fg=blue>-</>');
$style->setCrossingChar('<fg=blue>+</>');
$style->setCellHeaderFormat('%s');
$table = new Table($this);
$table->setStyle($style);
if ($headers) {
$table->setHeaders($headers);
}
$table->setRows($rows);
$table->render();
$this->newLine();
}