Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function placeBefore($beforeKey, $column) {
- $columns = $this->crud->getColumns();
- $i = 0;
- $newCols = [];
- foreach($columns as $key => $data) {
- if($key !== $beforeKey) {
- $newCols[$key] = $data;
- $i++;
- } else {
- $newCols[$column['name']] = $column;
- break;
- }
- }
- $sliced = array_slice($columns, $i);
- $cols = array_merge($newCols, $sliced);
- $this->crud->setColumns($cols);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement