Example #1
0
 /**
  * Profit colors
  *
  * @param $params
  * @param Cell $cell
  * @return mixed
  */
 public static function profit($params, Cell $cell)
 {
     $positive = 'text-primary';
     $negative = 'text-danger';
     $zero = 'text-muted';
     if (is_array($params)) {
         foreach ($params as $key => $value) {
             ${$key} = $value;
         }
     }
     $value = $cell->getOriginalValue();
     $cell->appendClass($value > 0 ? $positive : ($value < 0 ? $negative : $zero));
     return $cell->getCurrentValue();
 }