Google 網上論壇首頁
說明 | 登入
afterDelete question
目前本群組有太多主題設為優先顯示。 要優先顯示這個主題,請將其他主題的這個選項取消。
在處理您的要求時發生錯誤。 請再試一次。
標幟
  4 個訊息 - 全部摺疊
您要留言的群組是 Usenet 群組。在此群組留言,網際網路上的任何使用者將可以看到您的電郵地址。
您的回覆郵件尚未寄出。
您已成功留言
seanislegend  
檢視個人資料
(1 位使用者)  更多選項 9月8日, 上午5時23分
寄件者: seanislegend <boredofm...@googlemail.com>
日期: Sun, 7 Sep 2008 14:23:49 -0700 (PDT)
當地時間: 2008年9月8日(星期一) 上午5時23分
主旨: afterDelete question
Hey,

after I delete from a DB something I want to set a Flash message
saying if it's successfully been deleted or if there was an error.

I'm not sure how to implement this with afterDelete. Any ideas?

Thanks.


    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
Braindead  
檢視個人資料
 更多選項 9月8日, 下午1時06分
寄件者: Braindead <markus.he...@gmail.com>
日期: Sun, 7 Sep 2008 22:06:54 -0700 (PDT)
當地時間: 2008年9月8日(星期一) 下午1時06分
主旨: Re: afterDelete question
Hi,

there is no need to use the afterDelete event, because the delete
function of the model class gives a return value. Depending on the
return value you can set the flash message.
Pls. have a look at the API: http://api.cakephp.org/class_model.html#680f1a7876f7be4d87308d4df3252e77

I hope this helps.

Brain

On 7 Sep., 23:23, seanislegend <boredofm...@googlemail.com> wrote:


    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
alkemann  
檢視個人資料
 更多選項 9月8日, 下午4時26分
寄件者: alkemann <alek.morl...@gmail.com>
日期: Mon, 8 Sep 2008 01:26:51 -0700 (PDT)
當地時間: 2008年9月8日(星期一) 下午4時26分
主旨: Re: afterDelete question
        function delete($id = null) {
                if (!$id) {
                        $this->Session->setFlash(__('Invalid id for Contact', true));
                        $this->redirect(array('action'=>'index'));
                }
                if ($this->Contact->del($id)) {
                        $this->Session->setFlash(__('Contact deleted', true));
                        $this->redirect(array('action'=>'index'));
                }
        }

On 7 Sep, 23:23, seanislegend <boredofm...@googlemail.com> wrote:


    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
seanislegend  
檢視個人資料
 更多選項 9月9日, 上午12時57分
寄件者: seanislegend <boredofm...@googlemail.com>
日期: Mon, 8 Sep 2008 09:57:34 -0700 (PDT)
當地時間: 2008年9月9日(星期二) 上午12時57分
主旨: Re: afterDelete question
Thanks for your suggestions, I've already got it working without
afterDelete.

Thanks.

On Sep 8, 9:26 am, alkemann <alek.morl...@gmail.com> wrote:


    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
主題尾端
« 返回討論主題 « 較新的主題     較舊的主題 »

建立群組 - Google 網上論壇 - Google 首頁 - 服務條款 - 隱私權政策
©2008 Google