1

我在升级我的 joomla 版本时遇到了一些问题
我当前的版本是 joomla 1.5 使用jupgrade升级到 joomla2.5
它将我的模板文件复制到 joomla2.5 但是我在访问网站前端时出错

Fatal error: Class 'JParameter' not found in index.php on line 151

在 demo.php 第 151 行有以下代码

$jparams = new JParameter(''); $jparams->set( 'menutype', 'mainmenu' );
$hmenu = new hm_Base ($jparams); $hmenu->removeMenu(); 

给我任何建议以避免此类错误

4

3 回答 3

4

Jparameter is deprecated on joomla 2.5. use Jform instead, read http://docs.joomla.org/Upgrading_a_Joomla_1.5_extension_to_Joomla_1.6#Accessing_component_parameters_in_front-end

于 2012-05-16T00:49:21.993 回答
2

添加jimport( 'joomla.html.parameter' );到文件的顶部(可能就在其余的jimport语句之后

于 2012-02-21T19:53:29.430 回答
1

只需将其更改为:

$jparams = new JRegistry(''); $jparams->set( 'menutype', 'mainmenu' );
$hmenu = new hm_Base ($jparams); $hmenu->removeMenu();

对我来说很好...

于 2013-07-09T05:51:06.237 回答