簡體   English   中英

找不到Joomla錯誤類別'JModelLegacy'

[英]Joomla error Class 'JModelLegacy' not found

當我在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;

    }

如何解決此錯誤?

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

因此,您只需將JModelLegacy::addIncludePath更改為JModel::addIncludePath

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM