starting with Magento Backend

与世无争的帅哥 提交于 2019-12-02 13:31:55

问题


Since a couple of days I´m looking at the behaviour of the Magento backend. To comprehend I made a new grid to see a table of the bbdd. After finishing this grid I can see that I have a 404 error when try I to add a widget in a CMS page:

Debugging I can see that the error disappears if I comment this out of my custom module

<admin>
    <routers>
       <giftrouter>
            <use>admin</use>
            <args>
                <module>Wpr_Giftproducts_Adminhtml</module>
                <frontName>admin</frontName>
                <modules>
                    <sintax after="Wpr_Giftproducts_Adminhtml">Mage_Adminhtml</sintax>
                </modules>
            </args>
       </giftrouter>             

     </routers>     
</admin>

Concretely I think that the error was caused by this:

<sintax after="Wpr_Giftproducts_Adminhtml">Mage_Adminhtml</sintax>

But I don´t understand how this config works. How can I set a custom route to avoid conflict with the widget?


回答1:


I think you have your routers in reverse.

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <sintax before="Mage_Adminhtml">Wpr_Giftproducts_Adminhtml</sintax>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

This way the Giftproducts controller is part of the adminhtml router, whereas the old way was reassigning admin controllers to giftrouter.



来源:https://stackoverflow.com/questions/9534436/starting-with-magento-backend

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!