当前位置: 动力学知识库 > 问答 > 编程问答 >

php - Joomla error Class 'JModelLegacy' not found

问题描述:

When I am using a specific module in my Joomla website, I am getting this error

 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.

So you need to simply change JModelLegacy::addIncludePath to JModel::addIncludePath

分享给朋友:
您可能感兴趣的文章:
随机阅读: