/** * Creates a new Cancion model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Cancion(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('create', ['model' => $model]); } }
public function guardarCancion($nuevoNombre, $id_artista) { $ruta = "storage/Subidos/" . $nuevoNombre; $canciones = new Cancion(); $canciones->ruta = $ruta; $canciones->nombre_cancion = $nuevoNombre; $canciones->id_artista = $id_artista; $canciones->save(); }