cakephp 2 savefield 1

cakephp 2 savefield

$this->MemberLoginMethod->id = $id;
$this->MemberLoginMethod->saveField('enabled',  !$enabled);

Here is what the above code is Doing:
1. It’s getting the id of the record that was clicked on.
2. It’s getting the current value of the enabled field.
3. It’s saving the opposite of the current value of the enabled field.

Similar Posts