我打算在不使用 eZ Publish 呈现视图的情况下获得 json 响应。
所以我尝试使用自定义模块来做到这一点:
function jsonConvert(){
$articles = eZFunctionHandler::execute(
'content',
'tree',
array(
'parent_node_id' => '59'
)
);
header("Content-Type: application/json");
return json_encode($articles);
}
echo jsonConvert();
如何在不使用呈现 domain.com/module/view/ 之类的视图的基本 URL 的情况下编译此模块,以便在没有任何 HTML 代码的情况下获得 json 响应?