E
E
EVOSandru62015-01-27 08:41:55
Yii
EVOSandru6, 2015-01-27 08:41:55

How to display at least something from actionDelete in Yii?

Good afternoon, how to display information in the alert window in Yii ? So far, this only comes out if I intentionally make a syntax error in the model name.
I want to store information in a model with a NestedSet behavior attached to it . Here is a piece of external action code:

public $pk = 'id';
public $redirectTo = 'index';
public $modelClass;

function run(){
      if(empty($_GET[$this->pk]))
            throw new CHttpException(404);
        if($_GET[$this->pk] != 1){
            $model = CActiveRecord::model($this->modelClass)->findByPk((int)$_GET[$this->pk]);
            $model->NAME = 'Таракан';
            $model->EXIST = 0; 
            $model->saveNode();   
        } 
        else
            throw new Exception('Нельзя удалить корневой узел');
}

Nothing happens, but errors are not displayed in the pop-up window, where to dig?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Grechushnikov, 2015-01-27
@maxyc_webber

not enough information. rethink how the piece of code works. mentally walk

E
EVOSandru6, 2015-01-27
@EVOSandru6

Solved
$modelClass::model()->findByPk((int)$_GET[$this->pk])->deleteNode();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question