本文整理汇总了PHP中gpOutput::DoctypeMeta方法的典型用法代码示例。如果您正苦于以下问题:PHP gpOutput::DoctypeMeta方法的具体用法?PHP gpOutput::DoctypeMeta怎么用?PHP gpOutput::DoctypeMeta使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpOutput
的用法示例。
在下文中一共展示了gpOutput::DoctypeMeta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BufferOut
/**
* Complete the response by adding final content to the <head> of the document
* @static
* @since 2.4.1
* @param string $buffer html content
* @return string finalized response
*/
function BufferOut($buffer)
{
global $config, $gp_head_content, $gp_random, $page;
//get just the head of the buffer to see if we need to add charset
$pos = strpos($buffer, '</head');
if ($pos > 0) {
$head = substr($buffer, 0, $pos);
gpOutput::DoctypeMeta($head);
}
//replace the <head> placeholder with header content
$head_replacement = '<!-- get_head_placeholder ' . $gp_random . ' -->';
$buffer = str_replace($head_replacement, $gp_head_content, $buffer);
//add jquery if needed
$replacement = '';
if (strpos($buffer, '<script') !== false) {
if (isset($config['jquery']) && $config['jquery'] == 'google') {
$replacement = "\n<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\" type=\"text/javascript\"></script>";
} else {
$replacement = "\n<script type=\"text/javascript\" src=\"" . common::GetDir('/include/thirdparty/js/jquery.js') . "\"></script>";
}
}
$buffer = str_replace('<!-- jquery_placeholder ' . $gp_random . ' -->', $replacement, $buffer);
//if( gpdebug && count($_GET) == 0 && count($_POST) == 0 ){
// $buffer .= '<h3>'.number_format(memory_get_usage()).'</h3>';
// $buffer .= '<h3>'.number_format(memory_get_peak_usage()).'</h3>';
// $buffer .= '<h2>'.microtime_diff($_SERVER['REQUEST_TIME'],microtime()).'</h2>';
//}
return $buffer;
}