Joomla错误类'JModelLegacy'未找到

时间:2014-01-19 14:17:33

标签: php joomla

当我在Joomla网站上使用特定模块时,我收到此错误

 Class 'JModelLegacy' not found in sitename/modules/mod_map/helper.php on line 8

帮助文件包含以下代码:

<?php

defined('_JEXEC') or die;

jimport('joomla.application.component.model');
JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_content/models');

class mod_mapHelper{

    public function getPlace($params){

        $things = Array();

        $things['name'] = $params->get('placeName');
        $things['lat'] = $params->get('latitude');
        $things['long'] = $params->get('longitude');
        $things['zoom'] = $params->get('zoom');

        return $things;

    }

如何解决此错误?

1 个答案:

答案 0 :(得分:2)

我相信JModelLegacy被添加到Joomla 2.5中(不确定确切版本)因此Joomla 1.7不支持此功能。

因此,您只需将JModelLegacy::addIncludePath更改为JModel::addIncludePath

即可