com_modules插件正在安装,但没有执行


plugin for com_modules is getting installed but no execution

我正在尝试创建com_modules插件,以便每当保存被触发插件必须执行两个活动,即保存之前和保存之后。

不知何故我创建了插件…也被激活了

mywebsite.com/plugins/modules/myplugin.php 
mywebsite.com/plugins/modules/myplugin.xml

但是它没有被执行,甚至类…我在myplugin.php中犯了错误,但即使这些错误也没有在网站上显示任何错误。

你能告诉我怎样才能摆脱这个问题吗?还是我做错了什么?

defined( '_JEXEC' ) or die( 'Restricted access' );
// Load the Joomla Plugin
jimport( 'joomla.plugin.plugin' );

$GLOBALS[context]="com_modules.module";
//ini_set('error_reporting', E_ALL); 
class plgModulesMyplugin extends JPlugin{

// edit here first
    public function onExtensionBeforeSave($context, $table, $isNew)
    {   

Joomla插件根据特定事件执行。如果你的插件不工作,可能是因为你的插件没有正确绑定事件。首先确保事件被插件击中。