controllers/VideosController.php
/**
     * Deletes an existing Sugerencias model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Deletes an existing Sugerencias model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Deletes an existing Sugerencias model . If deletion is successful the browser will be redirected to the ' index ' page . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionBorrar()
    {
        $id = Yii::$app->request->post('video');
        $idselec = (array)Yii::$app->request->post('idselec');
        foreach (Videos::findAll($idselec) as $videos) {
            $videos->categoria_id = $id;
            $this->findModel($videos)->delete();
        }
        return $this->redirect(['videos/index']);
    }
public function actionBorrar ( ) { $ id = Yii :: $ app -> request -> post ( 'video' ) ; $ idselec = ( array ) Yii :: $ app -> request -> post ( 'idselec' ) ; foreach ( Videos :: findAll ( $ idselec ) as $ videos ) { $ videos -> categoria_id = $ id ; $ this -> findModel ( $ videos ) -> delete ( ) ; } return $ this -> redirect ( [ 'videos/index' ] ) ; }
Deletes an existing Sugerencias model.
Deletes an existing Sugerencias model .