protected function createLine(Table $table, $yamlLine, Scope $scope)
 {
     if (!is_array($yamlLine)) {
         $lineLabel = $yamlLine;
     } else {
         if (!array_key_exists('label', $yamlLine)) {
             throw new ParsingException("Each 'lines' from 'HorizontalTable' must contains a 'label'");
         }
         $lineLabel = $yamlLine['label'];
     }
     $line = new Line($this->twigExecutor->parse($lineLabel, $scope));
     $table->addLine($line);
 }
 protected function createLine(Table $table, $yamlLine, Scope $scope)
 {
     // Add the line
     $line = new Line();
     $table->addLine($line);
     // Then parse Cells.
     if (is_array($yamlLine) && array_key_exists('cells', $yamlLine) && is_array($yamlLine['cells'])) {
         $columnIndex = 0;
         foreach ($yamlLine['cells'] as $yamlCell) {
             $columnIndex += $this->parseCell($table, $line, $columnIndex, $yamlCell, $scope);
         }
     }
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function build(Sheet $sheet, $yamlContent, Scope $scope)
 {
     $table = new Table();
     $table->addLine(new Line());
     $sheet->addTable($table);
 }