Advertisement
Guest User

Untitled

a guest
May 6th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. public function getTotal($records, $column)
  2. {
  3. $total = 0;
  4. foreach ($records as $record)
  5. {
  6. $total += $record->$column;
  7. }
  8. return $total;
  9. }
  10.  
  11. 'weight' => array(
  12. 'name' => 'weight',
  13. 'footer' => $model->getTotal($model->search()->getData(), 'weight'),
  14. 'headerHtmlOptions' => array('width' => 50)
  15. ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement