/** * @param AddEditCategoryBindingModel $input * @param Categories $category * @Authorized('/login') * @UserRole(0,1) */ public function add(AddEditCategoryBindingModel $input, Categories $category) { //return var_dump($input->post('title')); $file_name = time() . rand(100, 999); $file = FileUpload::postImage($_FILES['photo'], $file_name, __DIR__ . '/../../../public/user_data/categories', false, 300); $category->add($input->title, $input->description, $file); $this->redirect->to('/products')->go(); }