public function fabrics() { $prod = Product::find(Input::get('id')); $brand = \App\Library\Helper::getBrand($prod); // dd($brand); $finish = Finish::where('brand', $brand)->with('fabrics')->get(); $action = 'admin.products.updatefabrics'; return view(Config('constants.adminProductView') . '.fabrics', compact('finish', 'prod', 'action')); }
public function actionFinish() { $db = new InstallConfig(); try { $db->con(); } catch (\yii\db\Exception $e) { $this->redirect('?r=install/config'); } if (User::find()->All() === null) { return $this->redirect('?r=install/user'); } $model = new Finish(); if ($model->load(Yii::$app->request->post())) { //$model->save(); if ($model->make()) { return $this->redirect('../'); } } return $this->render('finish', array('model' => $model)); //redierct }