【发布时间】:2013-04-25 09:27:08
【问题描述】:
我按照 magento U,配置 XML 的说明进行操作。但 XML 配置在我这边不起作用。
这是我已经完成的代码。
app/etc/First_Module.xml
<?xml version="1.0"?>
<config>
<modules>
<First_Module>
<active>true</active>
<codePool>local</codePool>
</First_Module>
</modules>
</config>
在本地代码池中
First/Module/etc/config.xml
<?xml version="1.0"?>
<config>
<default>
<some>
<ranadom>
<xpath>Here is value</xpath>
</ranadom>
</some>
</default>
</config>
现在,我想在 cmsController indexAction() 中调用 xpath 值
为此,我已将代码放入 cms/contollers/indexAction()
echo "test";
echo Mage::getStoreConfig('some/random/xpath');
die;
借助 echo Mage::getStoreConfig('some/random/xpath');我是 xpath Tag 的调用值。
那时我的 cms indexAction() 将调用。我可以看到这是价值。
谁能告诉我哪里错了?
【问题讨论】:
-
在 config.xml 中使用“ranadom”,然后使用“random”调用配置值。只是一个错字?
-
谢谢 Jonathan Hussey,在我的 config.xml 中你有一个错字。