How do I return JSON from an action in FW/1?

前端 未结 3 614
情书的邮戳
情书的邮戳 2021-01-24 20:50

FW/1 seems to be oriented to returning complete web pages what if JSON data is needed? A typical layout looks like:



        
3条回答
  •  野的像风
    2021-01-24 21:07

    As of FW/1 2.2, you can call:

    variables.fw.renderData( "json", result );
    

    in your controller and it will do what you want.

提交回复
热议问题