【发布时间】:2012-03-02 07:44:11
【问题描述】:
我在控制器中有以下代码:
function add() {
if (!empty($this->data)) {
if ($this->Password->save($this->data)) {
$this->Session->setFlash('the password I_WANT_TO_DISPLAY_THE_INSERTED_PASSWORD_HERE was added');
$this->redirect(array('action' => 'index'));
}
}
}
问题是如何在视图中显示插入的信息? 一条消息“密码 XXX 已添加到您的数据库中”。 我认为必须从文本字段中检索数据。我不知道如何在 cakePHP 中做到这一点。
【问题讨论】: