【问题标题】:add JsonP-Format for callback function to restler为restler添加回调函数的JsonP-Format
【发布时间】:2014-04-30 06:48:23
【问题描述】:

我正在尝试将 JSONP 格式添加到没有运气的 lucarest restler api

正如这个帖子中提到的 jsonpsupport

我在我的 vendor/ 文件夹中添加了一个带有给定上下文的新文件 jsonpformat.php restler.php 驻留。 然后我添加了

$r->setSupportedFormats('JsonpFormat','JsonFormat', 'XmlFormat');

到我的 index.php 但restlerExlorer 不再启动,服务器日志显示

...RestException' 并带有消息“找不到类 'JsonpFormat'”...

但我把它放到线程中盯着的文件夹中...... 帮助会很棒。 谢谢 英格

【问题讨论】:

    标签: php jsonp restler


    【解决方案1】:

    我们在同一个线程中接受了建议,并将我们的 JSONP 格式命名为 JsFormat

    所以就用

    $r->setSupportedFormats('JsFormat','JsonFormat', 'XmlFormat');
    

    【讨论】:

      猜你喜欢
      • 2016-04-03
      • 2019-12-07
      • 2014-04-03
      • 1970-01-01
      • 1970-01-01
      • 2013-02-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多