3

我正在尝试将组件从 joomla2.5 升级到 joomla 3,但出现此错误:

致命错误:在第 9 行的 /home/evolve13/public_html/components/components/com_donation/donation.php 中调用未定义的方法 JController::getInstance()

这是donation.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();
4

1 回答 1

3

在 Joomla 3X 上,您需要使用旧版控制器……试试下面的代码。更改JController::getInstance('Donation');
JControllerLegacy::getInstance('Donation');

于 2015-03-13T07:38:04.650 回答