本文整理汇总了PHP中JResponse::appendBody方法的典型用法代码示例。如果您正苦于以下问题:PHP JResponse::appendBody方法的具体用法?PHP JResponse::appendBody怎么用?PHP JResponse::appendBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JResponse
的用法示例。
在下文中一共展示了JResponse::appendBody方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAfterRender
function onAfterRender()
{
global $mainframe;
if ($mainframe->isAdmin()) {
return;
}
$app =& JFactory::getApplication();
$theme = $this->params->get('theme', 'default');
if ($theme == 'custom') {
$theme = $this->params->get('custom_theme', 'default');
}
$file = file_get_contents(JURI::base() . "plugins/system/pretty/html/" . $theme . ".html", true);
if ($file != null && $file != '') {
$popup = '0';
$file = preg_replace("/popupid/", $popup, $file);
}
JResponse::appendBody($file);
}
示例2: debugLanguage
/**
* @return void
*/
public static function debugLanguage()
{
ob_start();
$lang = JFactory::getLanguage();
echo '<h4>Parsing errors in language files</h4>';
$errorfiles = $lang->getErrorFiles();
if (count($errorfiles)) {
echo '<ul>';
foreach ($errorfiles as $file => $error) {
echo "<li>{$error}</li>";
}
echo '</ul>';
} else {
echo '<pre>None</pre>';
}
echo '<h4>Untranslated Strings</h4>';
echo '<pre>';
$orphans = $lang->getOrphans();
if (count($orphans)) {
ksort($orphans, SORT_STRING);
foreach ($orphans as $key => $occurance) {
$guess = str_replace('_', ' ', $key);
$parts = explode(' ', $guess);
if (count($parts) > 1) {
array_shift($parts);
$guess = implode(' ', $parts);
}
$guess = trim($guess);
$key = trim(strtoupper($key));
$key = preg_replace('#\\s+#', '_', $key);
$key = preg_replace('#\\W#', '', $key);
// Prepare the text
$guesses[] = $key . '="' . $guess . '"';
}
echo "\n\n# " . $file . "\n\n";
echo implode("\n", $guesses);
} else {
echo 'None';
}
echo '</pre>';
$debug = ob_get_clean();
JResponse::appendBody($debug);
}
示例3: exit_handler
static function exit_handler($hook)
{
global $mainframe, $_PROFILER;
$data = $mainframe->_dispatchEnd();
$mainframe->render($data);
if (JDEBUG) {
$_PROFILER->mark('afterRender');
JResponse::appendBody(implode('', $_PROFILER->getBuffer()));
}
echo JResponse::toString($mainframe->getCfg('gzip'));
$mainframe->close();
}