我正在尝试将组件从joomla2.5升级到joomla 3 但是我收到此错误:
致命错误:在第 9 行/home/evolve13/public_html/components/components/com_donation/donation.php 中调用未定义的方法 JController::getInstance()
以下是捐赠代码.php:
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by Donation
JController::getInstance('Donation');
// Perform the Request task
$controller->execute(JRequest::getCmd('task'));
// Redirect if set by the controller
$controller->redirect();
在Joomla 3X上,你需要使用传统的控制器...请尝试以下代码。更改JController::getInstance('Donation');
到JControllerLegacy::getInstance('Donation');