如何在菜单上使用事件点击Joomla插件?

时间:2013-04-10 19:44:51

标签: events plugins joomla menu triggers

我想在某些菜单或类别的菜单选项上使用Joomla插件的事件。怎么做的?是否有当前插件可以执行此操作以便查看代码?

瑞克

1 个答案:

答案 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:

}