1
在我正在處理的網站上,我從我的安裝中添加了/ public_html/libraries/joomla/document/json,因爲它不在那裏。該網站運行在1.5和本地我使用Joomla 2.5jDocument類在/ libraries/joomla/document/json被忽略
我的網址有添加&format=json
,但可以看到響應標頭是text/html。也許2.5中的文件與1.5不兼容。它具有以下內容:
<?php
defined('JPATH_PLATFORM') or die;
class JDocumentJSON extends JDocument
{
protected $_name = 'joomla';
public function __construct($options = array())
{
parent::__construct($options);
$this->_mime = 'application/json';
$this->_type = 'json';
}
public function render($cache = false, $params = array())
{
JResponse::allowCache(false);
JResponse::setHeader('Content-disposition', 'attachment; filename="' . $this->getName() . '.json"', true);
parent::render();
return $this->getBuffer();
}
public function getName()
{
return $this->_name;
}
public function setName($name = 'joomla')
{
$this->_name = $name;
return $this;
}
}
你是說你只是從2.5中拉出一些文件並將其卡入1.5?不,這不會起作用。 – Elin
@Elin謝謝你消除不起作用的東西。在一個不相關的主題上;你知道1.5的API參考嗎?它似乎不在Joomla網站上,或者它們隱藏起來很不錯。 – HMR
@Elin發現它:http://docs.joomla.org/Framework/1.5重定向到另一個也被刪除的頁面。我爲所有那些花時間撰寫和翻譯這些文件的人感到抱歉。 – HMR