当前位置: 动力学知识库 > 问答 > 编程问答 >

disable json for certain functions or controllers in cakephp 3.3

问题描述:

I have been able to active json extension in Cakephp 3.3 where by only adding .json to the end of controller url it will return a json response. However right now it does this for every function in every controller. Is there a way to specify that it only be done for a certain controller or even a specific function. I've gone through the Cakephp 3.x cookbook and there's no mention of how to implement this anywhere. Right now the only way I think this can be done is to stop using the extension entirely and just make a json encoded function but this would be against best practices. Any help at all would be greatly appreciated.

分享给朋友:
您可能感兴趣的文章:
随机阅读: