Sencha touch Joomla:如何将文章输出为JsonP?

Sencha touch Joomla:如何将文章输出为JsonP?,sencha-touch,php,json,joomla,Sencha Touch,Php,Json,Joomla,我想知道是否有一种简单的方法可以将文章输出为JsonP?我需要在应用程序中将其作为web服务使用 Callback({'response': [{'<div>some random html content</div>'}], 'success': true}); 回调({'response':[{'some random html content'}],'success':true}); JSON使用PHP对其进行编码 是的,我看过那些文档。但这是一个模块还是一个插

我想知道是否有一种简单的方法可以将文章输出为JsonP?我需要在应用程序中将其作为web服务使用

Callback({'response': [{'<div>some random html content</div>'}], 'success': true});
回调({'response':[{'some random html content'}],'success':true});

JSON使用PHP对其进行编码


是的,我看过那些文档。但这是一个模块还是一个插件?你把它放在哪里?我是一个.NET的人,所以我有点不清楚如何处理这个问题。只是一个想法,你可能也想尝试搜索。另外,据我所知,这并不是在创建JSONP。@YGomez-我去了那里,做了以下搜索,没有结果
+joomla+json
我从未用json测试过它,但我认为它与xml相同,创建一个视图并为其提供扩展名.json,当调用url&format=jsonI中添加的文章时,您知道有json编码。我需要一个模块来自动完成这项工作。
<?php
// Set up the data to be sent in the response.
$data = array( 'some data' );

// Get the document object.
$document =& JFactory::getDocument();

// Set the MIME type for JSON output.
$document->setMimeEncoding( 'application/json' );

// Change the suggested filename.
JResponse::setHeader( 'Content-Disposition', 'attachment; filename="'.$view->getName().'.json"' );

// Output the JSON data.
echo json_encode( $data );