Guest User

Untitled

a guest
Oct 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. [
  2. 'label' => 'Status',
  3. 'attribute' => 'activeStatus',
  4. 'format' => 'html',
  5. 'value'=>function ($data){return $data->activeStatus ? '<span class="label label-success">Active</span>' : '<span class="label label-danger">Inactive</span>';}
  6. ],
  7.  
  8. [
  9. 'label' => 'Status',
  10. 'attribute' => 'activeStatus',
  11. 'format' => 'html',
  12. 'value' => function ($data){
  13. return $data->activeStatus ? '<span class="label label-success">Active</span>' : '<span class="label label-danger">Inactive</span>';
  14. },
  15. 'filter' => [1 => 'Active', 0 => 'Inactive'],
  16. ],
  17.  
  18. public function rules()
  19. {
  20. return [
  21. [['activeStatus'], 'integer'],
  22. .
  23. .
  24. .
  25. ];
  26. }
  27.  
  28. // grid filtering conditions
  29. $query->andFilterWhere([
  30. 'activeStatus' => $this->activeStatus,
  31. ]);
Add Comment
Please, Sign In to add comment