src/Extension/Core/Type/CompoundColumnType.php
public function buildCellView(CellView $view, ColumnInterface $column, array $options)
    {
        $parent = $view->column;

        // Set shared information from the header.
        // This information is not recomputed for better performance.
        // Each header is created once, but this method will be called
        // 5000 times for a grid with 500 rows!

        $view->vars = array_replace($view->vars, [
            'cell_attr' => $options['cell_attr'],
            'unique_block_prefix' => $parent->vars['unique_block_prefix'],
            'block_prefixes' => $parent->vars['block_prefixes'],
            'cache_key' => $parent->vars['cache_key'],
        ]);

        $cells = [];

        $headers = $view->column->vars['_sub_headers'];

        /** @var CompoundColumn $column */
        foreach ($column->getColumns() as $subColumn) {
            $name = $subColumn->getName();

            $subView = $subColumn->createCellView($headers[$name], $view->source, $view->vars['row']);
            $subView->vars['compound'] = true;

            $cells[$name] = $subView;
        }

        return $view->value = $cells;
    }
public function buildCellView(CellView $view, ColumnInterface $column, array $options)
    {
        $parent = $view->column;

        // Set shared information from the header.
        // This information is not recomputed for better performance.
        // Each header is created once, but this method will be called
        // 5000 times for a grid with 500 rows!

        $view->vars = array_replace($view->vars, [
            'cell_attr' => $options['cell_attr'],
            'unique_block_prefix' => $parent->vars['unique_block_prefix'],
            'block_prefixes' => $parent->vars['block_prefixes'],
            'cache_key' => $parent->vars['cache_key'],
        ]);

        $cells = [];

        $headers = $view->column->vars['_sub_headers'];

        /** @var CompoundColumn $column */
        foreach ($column->getColumns() as $subColumn) {
            $name = $subColumn->getName();

            $subView = $subColumn->createCellView($headers[$name], $view->source, $view->vars['row']);
            $subView->vars['compound'] = true;

            $cells[$name] = $subView;
        }

        return $view->value = $cells;
    }
{@inheritdoc}