本文整理汇总了PHP中Q_Request::contentToEcho方法的典型用法代码示例。如果您正苦于以下问题:PHP Q_Request::contentToEcho方法的具体用法?PHP Q_Request::contentToEcho怎么用?PHP Q_Request::contentToEcho使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q_Request
的用法示例。
在下文中一共展示了Q_Request::contentToEcho方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Q_response
//.........这里部分代码省略.........
$to_encode['scriptLines'][$slotName] = $temp;
}
$temp = Q_Response::scriptData($slotName);
if ($temp) {
$to_encode['scriptData'][$slotName] = $temp;
}
$temp = Q_Response::templateData($slotName);
if ($temp) {
$to_encode['templates'][$slotName] = $temp;
}
}
} else {
$to_encode['slots'] = Q_Response::slots(true);
// add stylesinline, scriptlines, scriptdata, templates
foreach (array_merge(array(''), $slotNames) as $slotName) {
$temp = Q_Response::stylesInline($slotName);
if ($temp) {
$to_encode['stylesInline'][$slotName] = $temp;
}
$temp = Q_Response::scriptData($slotName);
if ($temp) {
$to_encode['scriptData'][$slotName] = $temp;
}
$temp = Q_Response::scriptLines($slotName, true, "\n", false);
if ($temp) {
$to_encode['scriptLines'][$slotName] = $temp;
}
}
}
}
}
}
$to_encode['timestamp'] = microtime(true);
$echo = Q_Request::contentToEcho();
if (isset($echo)) {
$to_encode['echo'] = $echo;
}
$json = Q::json_encode(Q::cutoff($to_encode));
$callback = Q_Request::callback();
switch (strtolower($isAjax)) {
case 'iframe':
if (!Q_Response::$batch) {
header("Content-type: text/html");
}
echo <<<EOT
<!doctype html><html lang=en>
<head><meta charset=utf-8><title>Q Result</title></head>
<body>
<script type="text/javascript">
window.result = function () { return {$json} };
</script>
</body>
</html>
EOT;
break;
case 'json':
default:
if (!Q_Response::$batch) {
header("Content-type: " . ($callback ? "application/javascript" : "application/json"));
}
echo $callback ? "{$callback}({$json})" : $json;
}
return;
}
// If this is a request for a regular webpage,
// fill the usual slots and render a layout.