Webmozart\Console\UI\Component\Grid::addCell PHP Méthode

addCell() public méthode

Adds a data cell to the grid.
public addCell ( string $cell ) : static
$cell string The data cell.
Résultat static The current instance.
    public function addCell($cell)
    {
        $this->cells[] = $cell;
        return $this;
    }

Usage Example

Exemple #1
0
 /**
  * Prints the resources in the short style (without the "-l" option).
  *
  * @param IO                 $io        The I/O.
  * @param ResourceCollection $resources The resources.
  */
 private function listShort(IO $io, ResourceCollection $resources)
 {
     $style = GridStyle::borderless();
     $style->getBorderStyle()->setLineVCChar('  ');
     $grid = new Grid($style);
     foreach ($resources as $resource) {
         $grid->addCell($this->formatName($resource));
     }
     $grid->render($io);
 }