CakePHP에서 사용자 및 작업으로 약간의 응용 프로그램을 만들었습니다. 삭제하려는 사용자를 삭제하려는 경우 'status'열이 '1'에서 '0'인 데이터베이스의 값만 변경하십시오. 나는 그것을 어떻게하는지 모른다.UsersController에서 데이터베이스로 데이터 저장 - CakePHP
사용자 컨트롤러의 코드 (삭제) :
public function delete($id = null)
{
$this->request->allowMethod(['post', 'delete']);
$user = $this->Users->get($id);
if ($user['status'] == '1') {
//Here should be code about change value
$this->Flash->success(__('The user has been deleted.'));
} else {
$this->Flash->error(__('The user could not be deleted. Please, try again.'));
}
return $this->redirect(['action' => 'index']);
}
어떤 아이디어?
북을 읽으십시오. http://book.cakephp.org/3.0/en/orm/saving-data.html 이것은 프레임 워크의 기본에 대해 잘 모르는 것처럼 들리므로 시작하기 위해 자습서를 할 것을 권장합니다. – burzum