【问题标题】:Fatal error: Call to undefined method JController::getInstance() in joomla 3致命错误:在 joomla 3 中调用未定义的方法 JController::getInstance()
【发布时间】:2015-02-04 09:28:39
【问题描述】:

我正在尝试将组件从 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();

【问题讨论】:

标签: php joomla components joomla-component joomla3.3


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2013-07-27
    • 1970-01-01
    • 1970-01-01
    • 2015-08-22
    • 2015-01-28
    • 2015-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多