WIP: Add grid icon column.

pull/3064/head
Julio Montoya 5 years ago
parent c8c8e0a275
commit da1b63f18b
  1. 34
      src/CoreBundle/Grid/Column/IconColumn.php

@ -0,0 +1,34 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\CoreBundle\Grid\Column;
use APY\DataGridBundle\Grid\Column\Column;
/**
* Class IconColumn.
*/
class IconColumn extends Column
{
public function __initialize(array $params)
{
$params['filterable'] = false;
$params['sortable'] = false;
parent::__initialize($params);
}
public function getType()
{
return 'icon';
}
public function renderCell($value, $row, $router)
{
if ($value) {
return "<img src=\"{{ '/".$value."' | apply_filter('small') }}\">";
}
return false;
}
}
Loading…
Cancel
Save