3
使用我的Joomla插件,我想在创建输出之前获取并修改所有内容。Joomla插件在输出前获取整个页面的内容
function newContent($html)
{
$html = "new content";
return $html;
}
function onContentPrepare()
{
ob_start(array($this, "newContent"));
return true;
}
function onContentBeforeDisplay()
{
ob_end_flush();
return true;
}
我试着用onContentAfterDisplay
但它仍然只改变一小部分,而不是所有的输出。
嗨,我想获得和修改所有内容(头,体,尾),所有的页面,不仅文章 –
@Vasile亚历喜兽疫,我我更新了我的答案。 – arbogastes
嗨,它的工作原理,谢谢。 –