Parameters Joomla 3.2中的组件参数为空

Parameters Joomla 3.2中的组件参数为空,parameters,joomla2.5,joomla3.0,joomla1.6,Parameters,Joomla2.5,Joomla3.0,Joomla1.6,我正在将一个Joomla 1.6组件移植到3.2。在1.6中,我能够在组件视图中读取通过config.xml定义的组件参数。在3.2中,参数为空,因为$imagepath值始终设置为'impossibru!' 这是我在视图中使用的代码: <?php // Check to ensure this file is included in Joomla! defined('_JEXEC') or die(); jimport( 'joomla.application.component.v

我正在将一个Joomla 1.6组件移植到3.2。在1.6中,我能够在组件视图中读取通过config.xml定义的组件参数。在3.2中,参数为空,因为$imagepath值始终设置为'impossibru!'

这是我在视图中使用的代码:

<?php

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

jimport( 'joomla.application.component.view' );

class BooomViewGame extends JViewLegacy
{
    function display($tpl = null)
    {
        var_dump(JComponentHelper::getComponent('com_booom')); //debug

        $params =& JComponentHelper::getParams('com_booom');
        var_dump($params);  //debug

        // Read the path parameter.
        $imagepath = $params->get('imagepath', 'impossibru!');

        // Make the path available on the template.
        $this->assignRef('imagepath', $imagepath);

        [some other stuff]
        parent::display($tpl);
    }
}
?>
<?xml version="1.0" encoding="utf-8"?>
<config>
    <fieldset name="component">
        <field name="imagepath" type="text" default="images" label="Image path" description="Path to images of the game."/>
    </fieldset>
</config>
object(stdClass)#119 (4) { ["id"]=> string(5) "10004" ["option"]=> string(9) "com_booom" ["params"]=> object(JRegistry)#111 (1) { ["data":protected]=> object(stdClass)#118 (0) { } } ["enabled"]=> string(1) "1" }

object(JRegistry)#111 (1) { ["data":protected]=> object(stdClass)#118 (0) { } } 

正如您所看到的,JParameter对象不包含任何值。不过,我可以在joomla后端的配置部分查看并设置参数!有什么想法吗?

在您转到Joomla中的组件配置并单击“保存”按钮之前,视图中的参数不可用。

您能描述一下如何更改组件的配置吗?