[英]Joomla error Class 'JModelLegacy' not found
When I am using a specific module in my Joomla website, I am getting this error 当我在Joomla网站中使用特定模块时,出现此错误
Class 'JModelLegacy' not found in sitename/modules/mod_map/helper.php on line 8
Helper file includes this code: 帮助文件包含以下代码:
<?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;
}
How can I fix this error? 如何解决此错误?
I believe JModelLegacy
was added into Joomla 2.5 (not sure on the exact version) therefore Joomla 1.7 does not support this. 我相信
JModelLegacy
已添加到Joomla 2.5中(不确定确切版本),因此Joomla 1.7不支持此功能。
So you need to simply change JModelLegacy::addIncludePath
to JModel::addIncludePath
因此,您只需将
JModelLegacy::addIncludePath
更改为JModel::addIncludePath
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.