我如何在 joomla 2.5 中强制原始输出而不在 url 中传递 &format=raw ?
我试过这个controller.php
require_once (JPATH_BASE.DS.'libraries'.DS.'joomla'.DS.'document'.DS.'raw'.DS.'raw.php');
JFactory::$document = new JDocumentRaw();
//doesn't work, outputs only "Array"
和
JRequest::setVar('tmpl', 'component');//doesn't disable view rendering
和
$document = &JFactory::getDocument();
$doc = &JDocument::getInstance('raw');
$document = $doc;
//gives me Strict Standards: Only variables should be assigned by reference in ...
//and doesn't disable view rendering
由于我打印原始输出,我什至不构建 Jview 和东西,只是die()
从控制器,但我想看看是否有更好的方法?