我有一个样本:
plugins
--shopping
----jcomments
--------jcomment.php
--------jcomment.xml
in plugins / shopping / jcomments / jcomment.php
class plgShoppingJcomments extends JPlugin
function plgShoppingJcomments(&$subject, $config){
parent::__construct($subject, $config);
}
function onBeforeDisplayProductView(&$view) {
die('test');
}
}
我调用的组件com_shopping的view.html.php
JPluginHelper::importPlugin('shopping');
$dispatcher =& JDispatcher::getInstance();
$dispatcher->trigger( 'onBeforeDisplayProductView', $view);
但是我运行的代码是这个插件没有显示结果(die(“test”)),如何修复这个插件
答案 0 :(得分:0)
试试这个...... $ dispatcher->触发器('onBeforeDisplayProductView',array($ view)); (我只有60%确定这会起作用:D)