所有網頁 圖片 影片 地圖 新聞 網誌搜尋 Gmail 更多 »
最近造訪的群組 | 說明 | 登入
Google 網上論壇首頁
question about Request Handler
目前本群組有太多主題設為優先顯示。要優先顯示這個主題,請將其他主題的這個選項取消。
在處理您的要求時發生錯誤。請再試一次。
標幟
  3 個訊息 - 全部摺疊  -  將全文翻譯為 已翻譯 (查看所有原文)
您要留言的群組是 Usenet 群組。在此群組留言,網際網路上的任何使用者將可以看到您的電郵地址。
您的回覆郵件尚未寄出。
您已成功留言
 
寄件人:
收件人:
副本:
後續追蹤對象:
新增副本 | 新增後續追蹤對象 | 編輯主旨
主旨:
驗證:
為了確認,請輸入您在以下圖片中看到的字元,或輸入您按下存取圖示時所聽到的號碼。 注意聽並輸入您聽到的號碼
 
Paulos23  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月6日, 上午6時44分
寄件人: Paulos23 <paulitosthe...@gmail.com>
日期: Thu, 5 Nov 2009 14:44:47 -0800 (PST)
當地時間: 2009年11月6日(星期五) 上午6時44分
主旨: question about Request Handler
Hi people,
I am bulding an app which supports web services,where the returned
data may be XML or JSON.My idea is to create a component to handle
both types of data.In particular i use HttpSocket to hit the specific
url,then i take the data and finally i pass them to view.Now the
question i have is  if i can use RequestHandler Component for this
approach,coz i don't want to generate XML, JSON but manipulate it and
set it to view.

Any help would ne nice!


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
robustsolution  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月6日, 上午7時29分
寄件人: robustsolution <i...@robustsolution.net>
日期: Thu, 5 Nov 2009 15:29:00 -0800 (PST)
主旨: Re: question about Request Handler
request handler deals with reading request header and setting response
header

as for manipulation of the data as I know the cake 'Xml' library can
do it for xml data... example for parsing xml data as array

App::import('Xml');
$xml_instance =& new Xml();
if ($xml_instance->load($xml_data)) {
$xml_parsed_as_array = Set::reverse($xml_instance);
debug($xml_parsed_as_array);

}

as for json manipulation through at server side u can use the basic
json_encode/json_decode famous functions to convert PHP to json and
vice versa, and you can use the js helper or the javascript helper as
an alternative

On Nov 5, 10:44 pm, Paulos23 <paulitosthe...@gmail.com> wrote:


    回覆    回覆作者    轉寄  
您必須先登入才能張貼訊息。
若要張貼訊息,您必須先加入此群組
請在留言之前更新您訂閱設定網頁上的暱稱。
您沒有留言所需的權限。
paulos nikolo  
檢視個人資料   翻譯為 已翻譯 (查看原文)
 更多選項 11月6日, 上午8時34分
寄件人: paulos nikolo <paulitosthe...@gmail.com>
日期: Fri, 6 Nov 2009 02:34:23 +0200
當地時間: 2009年11月6日(星期五) 上午8時34分
主旨: Re: question about Request Handler

I see.I already use the code with Xml you suggest me with a different way by
using XPath and in the other way JPath for Json.both are smart ways of
mapping ,by accessing children of Xml-Json so you dont have to create 2
types of views 1 for Xml and 1 for Json.
Anyway thank you very much for your quick reply and suggestions!

2009/11/6 robustsolution <i...@robustsolution.net>


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

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