Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. private function placeBefore($beforeKey, $column) {
  2. $columns = $this->crud->getColumns();
  3. $i = 0;
  4. $newCols = [];
  5. foreach($columns as $key => $data) {
  6. if($key !== $beforeKey) {
  7. $newCols[$key] = $data;
  8. $i++;
  9. } else {
  10. $newCols[$column['name']] = $column;
  11. break;
  12. }
  13. }
  14. $sliced = array_slice($columns, $i);
  15. $cols = array_merge($newCols, $sliced);
  16.  
  17. $this->crud->setColumns($cols);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement