/** * {@inheritdoc} */ public function buildViewCell(Cell $cell, Table $table, array $options) { parent::buildViewCell($cell, $table, $options); if (0 < strlen($options['property_path'])) { $value = $table->getCurrentRowData($options['property_path']); } else { $value = $table->getCurrentRowKey(); } $data = []; if (is_array($options['data_map'])) { foreach ($options['data_map'] as $key => $property_path) { $data[is_string($key) ? $key : $property_path] = (string) $table->getCurrentRowData($property_path); } } $cell->setVars(['input_type' => $options['multiple'] ? 'checkbox' : 'radio', 'input_name' => $options['full_name'], 'value' => $value, 'data' => $data, 'selected' => false]); }
/** * {@inheritDoc} */ public function buildViewCell(Cell $cell, Table $table, array $options) { parent::buildViewCell($cell, $table, $options); $buttons = []; foreach ($options['buttons'] as $buttonOptions) { $parameters = $buttonOptions['route_parameters']; foreach ($buttonOptions['route_parameters_map'] as $parameter => $propertyPath) { $parameters[$parameter] = $table->getCurrentRowData($propertyPath); } $disabled = $buttonOptions['disabled']; if (0 < strlen($buttonOptions['disable_property_path'])) { $disabled = $table->getCurrentRowData($buttonOptions['disable_property_path']); } $buttons[] = ['disabled' => $disabled, 'label' => $buttonOptions['label'], 'icon' => $buttonOptions['icon'], 'class' => $buttonOptions['class'], 'route' => $buttonOptions['route_name'], 'parameters' => $parameters]; } $cell->setVars(['buttons' => $buttons]); }
/** * {@inheritdoc} */ public function buildViewCell(Cell $cell, Table $table, array $options) { parent::buildViewCell($cell, $table, $options); $cell->setVars(['value' => $table->getCurrentRowData($options['property_path']), 'sorted' => $options['sorted']]); }