如何使用PHP创建Odata服务? [英] How to create an Odata Service using PHP?

查看:86
本文介绍了如何使用PHP创建Odata服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Kendo-UI,在这个框架中我们可以使用ODATA,JSON-P,JSON读取数据。我们使用(json_encode())在PHP中使用JSON-P和JSON成功开发数据。但我们无法使用PHP创建ODATA。

I am using Kendo-UI, in this framework we can read the data using ODATA, JSON-P, JSON. We are successfully develop the data in JSON-P and JSON in PHP using(json_encode()). but we are unable to create ODATA using PHP.

我们必须使用PHP以ODATA格式制作编码数据。请查看我们需要的代码。请看下面。

We should have to make the encoded data in ODATA format using PHP. Please look at the code in which we needed this. Please look below.

{field: "Status", title: "Status", width: "150px", editor: function(container, options) {
          $('<input data-text-field="Name" data-value-field="Id" data-bind="value:' + options.field + '"/>').appendTo(container).kendoComboBox({
    index: 0,
    dataTextField: "Name",
    dataValueField: "Id",
    filter: "contains",
    dataSource: {
        type: "odata",
        serverFiltering: true,
        serverPaging: true,
        pageSize: 20,
        transport: {
            read: "http://odata.netflix.com/Catalog/Titles"
        }
    }
                  });
                 }
                 },

有什么想法将数据编码到此风格http://odata.netflix.com/Catalog/Titles?$format=json&$inlinecount=allpages&$callback=callback&$top=20

Is there any idea to encode the data into this style "http://odata.netflix.com/Catalog/Titles?$format=json&$inlinecount=allpages&$callback=callback&$top=20"

谢谢

A

推荐答案

你可以找到一个OData Producer使用PHP在这里: http://odataphpproducer.codeplex.com

You can find an OData Producer using PHP here: http://odataphpproducer.codeplex.com

可以在此处找到SDK的概述: http://blogs.msdn.com/b/interoperability/archive/2011/09/09/the-odata-producer-library-for-php-is-here .aspx

An overview of the SDK can be found here: http://blogs.msdn.com/b/interoperability/archive/2011/09/09/the-odata-producer-library-for-php-is-here.aspx

这篇关于如何使用PHP创建Odata服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆