backend/controllers/PortfolioController.php
/**
     * Deletes an existing Portfolio model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
Deletes an existing Portfolio model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
Deletes an existing Portfolio model . If deletion is successful the browser will be redirected to the ' index ' page . @param integer $id @return mixed
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        if($model->image)
            unlink(yii::getAlias('@root').'/uploads/portfolio/'.$model->image);
        $model->delete();
        return $this->redirect(['index']);
    }
public function actionDelete ( $ id ) { $ model = $ this -> findModel ( $ id ) ; if ( $ model -> image ) unlink ( yii :: getAlias ( '@root' ) . '/uploads/portfolio/' . $ model -> image ) ; $ model -> delete ( ) ; return $ this -> redirect ( [ 'index' ] ) ; }
Deletes an existing Portfolio model.
Deletes an existing Portfolio model .