protected function buildTableBody(TableBuilderInterface $builder, $options) { if ($options['use_tbody']) { $container = $builder->create('tbody', 'body', array()); $builder->add($container); } else { $container = $builder; } $count = (string) is_array($options['data']) ? count($options['data']) : $options['data']->count(); $padCount = strlen($count); $i = 1; foreach ($options['data'] as $item) { $rowNumber = str_pad($i++, $padCount, '0', STR_PAD_LEFT); $row = $builder->create('row' . $rowNumber, 'row', array()); foreach ($this->columns as $name => $info) { if (isset($info['options']['data_transformer']) && $info['options']['data_transformer'] instanceof DataTransformerInterface) { $transformer = $info['options']['data_transformer']; $value = $transformer->transform($item); } else { $value = $this->getValue($item, $name); } $type = $info['type']; $cell = $builder->create($name, $type, array('data' => $value)); $row->add($cell); } $cell = $builder->create('actions', 'crud_cell', array()); $row->add($cell); $this->buildRowActions($builder, $cell, $item, $options); $container->add($row); } }