简单的问题对于一些我确信。这个函数本身就是在做什么,但是这个消息在执行时没有被闪现。下面消息不在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