作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我如何在 cakephp 中编写 ["Content-Type"] = "text/xml"以及我必须在哪个文件中包含该文件。
请帮助。
谢谢。
最佳答案
Cake 方法是使用 RequestHandlerComponent::respondAs , 喜欢$this->RequestHandler->respondAs('xml')
,在 Controller 的某处。如果您的应用程序 is set up appropriately,这甚至可能会自动发生.
PHP 方法是在任何输出之前的任何位置(通常在 Controller 中的某个位置)发出 header('Content-Type: text/xml')
。
关于php - 如何在cakephp中写内容类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3341042/
我是一名优秀的程序员,十分优秀!