controllers/DefaultController.php
public function actionTaskdelete($id)
    {

        $task = Project::getTaskModel($id);
        $projectid = $task->projectID;
        $task->delete();

        return $this->redirect(['tasklist', 'projectid' => $projectid]);
    }
public function actionTaskdelete($id)
    {

        $task = Project::getTaskModel($id);
        $projectid = $task->projectID;
        $task->delete();

        return $this->redirect(['tasklist', 'projectid' => $projectid]);
    }
public function actionTaskdelete ( $ id ) { $ task = Project :: getTaskModel ( $ id ) ; $ projectid = $ task -> projectID ; $ task -> delete ( ) ; return $ this -> redirect ( [ 'tasklist' , 'projectid' => $ projectid ] ) ; }
Deletes an existing Tasks model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed
Deletes an existing Tasks model . If deletion is successful the browser will be redirected to the index page .