Example #1
0
 /**
  * {@inheritdoc}
  */
 public function buildViewCell(Cell $cell, Table $table, array $options)
 {
     parent::buildViewCell($cell, $table, $options);
     $label = ' ';
     if (array_key_exists($cell->vars['value'], $options['choices'])) {
         $label = $options['choices'][$cell->vars['value']];
     }
     $cell->setVars(['label' => $label]);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function buildViewCell(Cell $cell, Table $table, array $options)
 {
     parent::buildViewCell($cell, $table, $options);
     if (!empty($options['route_parameters_map'])) {
         $parameters = [];
         foreach ($options['route_parameters_map'] as $parameter => $propertyPath) {
             if (null !== ($value = $table->getCurrentRowData($propertyPath))) {
                 $parameters[$parameter] = $value;
             }
         }
         if (0 < count(array_diff_key($options['route_parameters_map'], $parameters))) {
             return;
         }
         $parameters = array_replace($parameters, $options['route_parameters']);
     } else {
         $parameters = $options['route_parameters'];
     }
     $cell->setVars(['route' => $options['route_name'], 'parameters' => $parameters]);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function buildViewCell(Cell $cell, Table $table, array $options)
 {
     parent::buildViewCell($cell, $table, $options);
     $route = $options['route_name'];
     if (null !== ($disablePath = $options['disable_property_path'])) {
         if ($table->getCurrentRowData($disablePath)) {
             $route = null;
         }
     }
     if (null !== $route) {
         $parameters = $options['route_parameters'];
         foreach ($options['route_parameters_map'] as $key => $propertyPath) {
             $parameters[$key] = $table->getCurrentRowData($propertyPath);
         }
     } else {
         $parameters = [];
     }
     $cell->setVars(array('label' => $cell->vars['value'] ? $options['true_label'] : $options['false_label'], 'class' => $cell->vars['value'] ? $options['true_class'] : $options['false_class'], 'route' => $route, 'parameters' => $parameters));
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function buildViewCell(Cell $cell, Table $table, array $options)
 {
     parent::buildViewCell($cell, $table, $options);
     $cell->setVars(['date_format' => $options['date_format'], 'time_format' => $options['time_format']]);
 }
Example #5
0
 /**
  * {@inheritDoc}
  */
 public function buildViewColumn(Column $column, Table $table, array $options)
 {
     parent::buildViewColumn($column, $table, $options);
     $column->setVar('sortable', false);
 }