我想在某些菜单或类别的菜单选项上使用Joomla插件的事件。怎么做的?是否有当前插件可以执行此操作以便查看代码?
瑞克
答案 0 :(得分:1)
我在https://github.com/betweenbrain/hideitems/blob/master/hideitems.php
有这样的话基本思想是做一些事情:
function onAfterRender() {
// The curent item ID
$itemId = JRequest::getInt('Itemid', 0);
// Parameter with item ids to run they are the item ID
$targetIds = $this->params->get('targetIds');
// Check if we are viewing a target ID
if (strpos($targetIds, $itemId)){
// do something awesome
return TRUE;
}
return FALSE:
}