我在Magento管理面板中创建了一个带网格的自定义模块,它运行正常。我怀疑是关于URL。对于默认的Magento模块,我得到的URL为:
magento_source/index.php/admin/cms_page/index/key/8b14fb90d8d50c24c0da008db9fd1672/
但对于我的自定义模块,我收到以下网址:
magento_source/index.php/demo/adminhtml_demo/index/key/fc732c9223b88a80ca1b17b2a0f12c95/
而不是
magento_source/index.php/admin/adminhtml_demo/index/key/8b14fb90d8d50c24c0da008db9fd1672/
我该怎么做才能解决这个问题?
我的config.xml文件:
<?xml version="1.0"?>
<config>
<modules>
<Blazedream_Demo>
<version>1.6.2.0.4</version>
</Blazedream_Demo>
</modules>
<frontend>
<routers>
<demo>
<use>standard</use>
<args>
<module>Blazedream_Demo</module>
<frontName>demo</frontName>
</args>
</demo>
</routers>
<layout>
<updates>
<demo>
<file>demo.xml</file>
</demo>
</updates>
</layout>
</frontend>
<admin>
<routers>
<demo>
<use>admin</use>
<args>
<module>Blazedream_Demo</module>
<frontName>demo</frontName>
</args>
</demo>
</routers>
</admin>
<adminhtml>
<menu>
<demo module="demo">
<title>Demo</title>
<sort_order>71</sort_order>
<children>
<items module="demo">
<title>Manage Items</title>
<sort_order>0</sort_order>
<action>demo/adminhtml_demo</action>
</items>
</children>
</demo>
</menu>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<demo>
<title>Demo Module</title>
<sort_order>200</sort_order>
</demo>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<demo>
<file>demo.xml</file>
</demo>
</updates>
</layout>
</adminhtml>
<global>
<models>
<demo>
<class>Blazedream_Demo_Model</class>
<resourceModel>demo_mysql4</resourceModel>
</demo>
<demo_mysql4>
<class>Blazedream_Demo_Model_Mysql4</class>
<entities>
<demo>
<table>demo</table>
</demo>
</entities>
</demo_mysql4>
</models>
<events>
<demo_save_before>
<observers>
<blazedream_demo_save_observer>
<type>singleton</type>
<class>demo/observer</class>
<method>demo_save_before</method>
</blazedream_demo_save_observer>
</observers>
</demo_save_before>
</events>
<resources>
<demo_setup>
<setup>
<module>Blazedream_Demo</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</demo_setup>
<demo_write>
<connection>
<use>core_write</use>
</connection>
</demo_write>
<demo_read>
<connection>
<use>core_read</use>
</connection>
</demo_read>
</resources>
<blocks>
<demo>
<class>Blazedream_Demo_Block</class>
</demo>
</blocks>
<helpers>
<demo>
<class>Blazedream_Demo_Helper</class>
</demo>
</helpers>
</global>
</config>
任何人都可以帮助我吗? 提前谢谢。
答案 0 :(得分:0)
如果您使用管理路由器,如下面的代码,那么它将生成您想要的URL。这段代码是默认的管理路由器。
<admin>
<routers>
<adminhtml>
<args>
<modules>
<Simbeez_Ponochange before="Mage_Adminhtml">Simbeez_Ponochange_Adminhtml</Simbeez_Ponochange>
</modules>
</args>
</adminhtml>
</routers>
</admin>