簡單的問題對於一些我確信。這個函數本身就是在做什麼,但是這個消息在執行時沒有被閃現。下面消息不在cakephp中閃爍編輯功能
功能:
function edit($id = null) {
if($this->Auth->user('id')==$id) {
$this->set('user', $this->User->read(null, $id));
} else {
$this->Session->setFlash(__('You are not authorized to edit other member profiles', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('Member profile saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('Member profile could not be saved. Please, try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
}
$groups = $this->User->Group->find('list');
$this->set(compact('groups'));
}
仍在學習CakePHP的繩索,點燃了一些很老的PHP技能 - 如此忍受我!謝謝!
在佈局(或視圖)中是否有'echo $ this-> Session-> flash();'? –
@mattb echo $ this-> Session-> flash('auth');坐在佈局。 – Plastika