本文整理匯總了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;
}