public function postEdit(Category $cat) { $cat->title = $this->request->get('title'); $cat->parent_id = $this->request->get('parent_id'); $cat->language = $this->request->get('language'); $cat->save(); return $this->redirector->route('cat.getEdit', ['id' => $cat->id]); }
private function get_categories() { $cats = Category::all(); $cats_array[0] = "..."; foreach ($cats as $cat) { $cats_array[$cat->id] = $cat->title; } return $cats_array; }