Example #1
0
 /**
  * @param \Twig_Environment $environment
  * @param \Sorien\DataGridBundle\Grid\Column\Column $column
  * @param \Sorien\DataGridBundle\Grid\Row $row
  * @param \Sorien\DataGridBundle\Grid\Grid $grid
  *
  * @return string
  */
 public function getGridCell(\Twig_Environment $environment, $column, $row, $grid)
 {
     $value = $column->renderCell($row->getField($column->getId()), $row, $this->router);
     if (($id = $this->names[$grid->getHash()]) != '') {
         if ($this->hasBlock($environment, $block = 'grid_' . $id . '_column_' . $column->getId() . '_cell')) {
             return $this->renderBlock($environment, $block, array('column' => $column, 'value' => $value, 'row' => $row));
         }
     }
     if ($this->hasBlock($environment, $block = 'grid_column_' . $column->getId() . '_cell')) {
         return $this->renderBlock($environment, $block, array('column' => $column, 'value' => $value, 'row' => $row));
     }
     return $value;
 }
Example #2
0
 public function renderCell($value, $row, $router)
 {
     if (key_exists((string) $value, $this->values)) {
         $value = $this->values[$value];
     }
     return parent::renderCell($value, $row, $router);
 }