Answer the question
In order to leave comments, you need to log in
How to pass the $id of the category to be deleted to beforeDelete?
I delete the selected category
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
public function beforeDelete()
{
if(parent::beforeValidate())
{
return true;
}
return FALSE;
}
Answer the question
In order to leave comments, you need to log in
public function beforeDelete()
{
if(parent::beforeDelete())
{
$this->id; //тут твой айди
return true;
}
return FALSE;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question