controllers/SugerenciasController.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('comentario');
        $idselec = (array)Yii::$app->request->post('idselec');
        foreach (Sugerencias::findAll($idselec) as $sugerencia) {
            $sugerencia->autor_id = $id;
            $this->findModel($sugerencia)->delete();
        }
        return $this->redirect(['sugerencias/index']);
    }
public function actionBorrar ( ) { $ id = Yii :: $ app -> request -> post ( 'comentario' ) ; $ idselec = ( array ) Yii :: $ app -> request -> post ( 'idselec' ) ; foreach ( Sugerencias :: findAll ( $ idselec ) as $ sugerencia ) { $ sugerencia -> autor_id = $ id ; $ this -> findModel ( $ sugerencia ) -> delete ( ) ; } return $ this -> redirect ( [ 'sugerencias/index' ] ) ; }
Deletes an existing Sugerencias model.
Deletes an existing Sugerencias model .