问题
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.
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"
}
}
});
}
},
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"
Thanks
A
回答1:
You can find an OData Producer using PHP here: http://odataphpproducer.codeplex.com
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
来源:https://stackoverflow.com/questions/9836764/how-to-create-an-odata-service-using-php