impordata.php (控制器)
<?php
defined ( '_JEXEC' ) or die ( 'Restricted access');
if(!class_exists('VmController'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmcontroller.php');
class VirtuemartControllerImportdata extends VmController {
function save() {
$file= JRequest::getVar('csv', null, 'files','array');
//print_r($file);
JPluginHelper::importPlugin('importdata');
$dispatcher = JDispatcher::getInstance();
$ret=$dispatcher->trigger('onImportdata', array(&$file));
//print_r($ret);
}
}
importdata.php 插件
<?php
// no direct access
defined('_JEXEC') or die;
class plgImportdataImportdata extends JPlugin {
public function onImportdata($data) {
echo "**********";
print_r($data);
echo $data;
}
}
插件没有从控制器调用你能告诉我哪里出错了吗? 从控制器调用插件!