本文整理匯總了PHP中Head::finalize方法的典型用法代碼示例。如果您正苦於以下問題:PHP Head::finalize方法的具體用法?PHP Head::finalize怎麽用?PHP Head::finalize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Head
的用法示例。
在下文中一共展示了Head::finalize方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: outputBufferFilter
/**
* This filter is run as the last thing before the output buffer is sent to the browser.
* It inserts the string registered with Head::add() does some output compression if possible.
* @param string $buffer
* @param integer $mode OB mode
* @return string
*/
function outputBufferFilter($buffer, $mode)
{
//FIXME: Uncomment?
//$buffer = trim($buffer);
/**
* Mail replace
*/
$buffer = SafeEmails::replace($buffer);
$headadd = Head::finalize();
if (is_array($headadd)) {
$buffer = preg_replace('#</head>#i', $headadd[0] . "\r\n</head>", $buffer, 1);
$buffer = preg_replace('#</body>#i', $headadd[1] . "\r\n</body>", $buffer, 1);
}
return $buffer;
}