DEV Community

Gabriel Alejandro López López
Gabriel Alejandro López López

Posted on • Edited on

1

Answer: How to toggle value in database on click of a button (YII2)

This is just a soft delete then: no actual row is deleted but "marked". Two parts for this code:

Controller


public function behaviors()
{
    return [
        //
        'verbs' => [
            'class' => \yii\filters\VerbFilter::className(),
            'actions' => [
                'delete' => ['POST'],
            ],
        ],
        // ....
    ];
}


public function actionDelete($id){
    $model

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more