所有網頁 圖片 影片 地圖 新聞 網誌搜尋 Gmail 更多 »
最近造訪的群組 | 說明 | 登入
Google 網上論壇首頁
setting displayField to a custom field
目前本群組有太多主題設為優先顯示。要優先顯示這個主題,請將其他主題的這個選項取消。
在處理您的要求時發生錯誤。請再試一次。
標幟
  4 個訊息 - 全部摺疊  -  將全文翻譯為 已翻譯 (查看所有原文)
您要留言的群組是 Usenet 群組。在此群組留言,網際網路上的任何使用者將可以看到您的電郵地址。
您的回覆郵件尚未寄出。
您已成功留言
 
寄件人:
收件人:
副本:
後續追蹤對象:
新增副本 | 新增後續追蹤對象 | 編輯主旨
主旨:
驗證:
為了確認,請輸入您在以下圖片中看到的字元,或輸入您按下存取圖示時所聽到的號碼。 注意聽並輸入您聽到的號碼
 
Dave  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月6日, 上午6時22分
寄件人: Dave <davidcr...@gmail.com>
日期: Thu, 5 Nov 2009 14:22:34 -0800 (PST)
當地時間: 2009年11月6日(星期五) 上午6時22分
主旨: setting displayField to a custom field
Hi fellow CakePHP enthusiasts.

I have a problem which I'm sure is probably pretty simple but I am not
sure how to do it.

I have a standard Users table with first name, last name, etc.

What I would like to do is set the displayField of the Users model to
a concatenation of first_name . " " . last_name

Now I am thinking that I can accomplish this by creating a custom
field in my model which concatenates these two fields, and set the
displayField to this, but I am not sure how to go about creating the
custom field.

Thanks in advance for any help!  I really appreciate it.

David Roda


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
euromark (munich)  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月6日, 下午7時01分
寄件人: "euromark (munich)" <dereurom...@googlemail.com>
日期: Fri, 6 Nov 2009 03:01:16 -0800 (PST)
當地時間: 2009年11月6日(星期五) 下午7時01分
主旨: Re: setting displayField to a custom field
there are behaviours for that (multiple_display_field)
or you do it manually by using "beforeFind()" in your model

On 5 Nov., 23:22, Dave <davidcr...@gmail.com> wrote:


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
David Roda  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月7日, 上午2時12分
寄件人: David Roda <davidcr...@gmail.com>
日期: Fri, 6 Nov 2009 13:12:43 -0500
當地時間: 2009年11月7日(星期六) 上午2時12分
主旨: Re: setting displayField to a custom field

Thanks euromark.

what type of logic would I be performing in beforeFind() to accomplish this
goal?

On Fri, Nov 6, 2009 at 6:01 AM, euromark (munich) <


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
Grzegorz Pawlik  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月9日, 下午5時39分
寄件人: Grzegorz Pawlik <grzegorzpaw...@gmail.com>
日期: Mon, 9 Nov 2009 01:39:53 -0800 (PST)
當地時間: 2009年11月9日(星期一) 下午5時39分
主旨: Re: setting displayField to a custom field
Shouldn't be in afterFind? When data grabbed from DB, You iterate
throug them and add do sth like this
$this->data[$n]['User']['whole_name'] = $this->data[$n]['User']
['name'] . " " . $this->data[$n]['User']['last_name'];

right?

On Nov 6, 7:12 pm, David Roda <davidcr...@gmail.com> wrote:


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

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