lib/controllers/ObjectController.php
public function actionDelete()
    {
        $subform = null;
        $p = $this->_parseParams();
        $this->_checkParams($p, ['object', 'type']);
        $this->params = &$p;
        $primaryModel = $p['type']->primaryModel;

        $this->params['model'] = new DeleteForm();
        if (isset($p['relation'])) {
            $this->params['model']->object = $p['object'];
            $this->params['model']->relationship = $p['relationship'];
            $this->params['model']->relationModel = $p['relation'];
            $this->params['model']->relationshipWith = $p['relatedObject'];
            $this->params['model']->object->indirectObject = $p['relatedObject'];
            $primaryObject = $p['object'];
        } else {
            $primaryObject = $p['object'];
            $this->params['model']->object = $p['object'];
        }

        if (empty($this->params['model']->possibleTargets)) {
            throw new HttpException(403, "You are not authorized to perform this action.");
        }

        Yii::$app->response->view = 'delete';
        Yii::$app->response->task = 'dialog';
        Yii::$app->response->taskOptions = ['title' => 'Delete ' . $p['type']->title->getSingular(true) , 'isConfirmDeletion' => true];

        if (!empty($_POST['DeleteForm'])) {
            Yii::$app->response->task = 'status';
            $targetDescriptor = $this->params['model']->targetDescriptor;
            $this->params['model']->attributes = $_POST['DeleteForm'];
            if (!$this->params['model']->handle()) {
                Yii::$app->response->error =  'Could not ' . $this->params['model']->targetLabel['long'];
            } else {
                Yii::$app->response->success = ucfirst($this->params['model']->targetLabel['past']) . '.';
                if (isset($this->params['model']->targetLabel['response']) && empty($p['relation'])) {
                    switch ($this->params['model']->targetLabel['response']) {
                        case 'home':
                            Yii::$app->response->redirect = '/';
                        break;
                        case 'refresh':
                            Yii::$app->response->refresh = true;
                        break;
                    }
                } else {
                    Yii::$app->response->trigger = [
                        ['refresh', '.model-' . $p['object']::baseClassName()],
                    ];
                }
            }
        }
    }
public function actionDelete()
    {
        $subform = null;
        $p = $this->_parseParams();
        $this->_checkParams($p, ['object', 'type']);
        $this->params = &$p;
        $primaryModel = $p['type']->primaryModel;

        $this->params['model'] = new DeleteForm();
        if (isset($p['relation'])) {
            $this->params['model']->object = $p['object'];
            $this->params['model']->relationship = $p['relationship'];
            $this->params['model']->relationModel = $p['relation'];
            $this->params['model']->relationshipWith = $p['relatedObject'];
            $this->params['model']->object->indirectObject = $p['relatedObject'];
            $primaryObject = $p['object'];
        } else {
            $primaryObject = $p['object'];
            $this->params['model']->object = $p['object'];
        }

        if (empty($this->params['model']->possibleTargets)) {
            throw new HttpException(403, "You are not authorized to perform this action.");
        }

        Yii::$app->response->view = 'delete';
        Yii::$app->response->task = 'dialog';
        Yii::$app->response->taskOptions = ['title' => 'Delete ' . $p['type']->title->getSingular(true) , 'isConfirmDeletion' => true];

        if (!empty($_POST['DeleteForm'])) {
            Yii::$app->response->task = 'status';
            $targetDescriptor = $this->params['model']->targetDescriptor;
            $this->params['model']->attributes = $_POST['DeleteForm'];
            if (!$this->params['model']->handle()) {
                Yii::$app->response->error =  'Could not ' . $this->params['model']->targetLabel['long'];
            } else {
                Yii::$app->response->success = ucfirst($this->params['model']->targetLabel['past']) . '.';
                if (isset($this->params['model']->targetLabel['response']) && empty($p['relation'])) {
                    switch ($this->params['model']->targetLabel['response']) {
                        case 'home':
                            Yii::$app->response->redirect = '/';
                        break;
                        case 'refresh':
                            Yii::$app->response->refresh = true;
                        break;
                    }
                } else {
                    Yii::$app->response->trigger = [
                        ['refresh', '.model-' . $p['object']::baseClassName()],
                    ];
                }
            }
        }
    }
[[@doctodo method_description:actionDelete]].

@throws HttpException [[@doctodo exception_description:HttpException]]