magento 插件后台访问url路径的改变

原创
2016/02/20 17:19
阅读数 452

1. 配置文件config.xml的修改

before

<admin>
    <routers>
        <adminhello>
            <use>admin</use>
            <args>
                <module>Pulsestorm_Adminhello</module>
                <frontName>admin_adminhello</frontName>
            </args>
        </adminhello>
    </routers>
</admin>


after

<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <adminhello before="Mage_Adminhtml">Pulsestorm_Adminhello_Adminhtml</adminhello>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>


2. 控制器路径修改

before

/app/code/local/Pulsestorm/Adminhello/controllers/Adminhtml/AdminhellobackendController.php

after

/app/code/local/Pulsestorm/Adminhello/controllers/Adminhtml/Adminhello/AdminhellobackendController.php

相应的class命名也要变


3. 如果有adminhtml.xml

before

<action>adminhello/adminhtml_adminhellobackend</action>


after

<action>adminhtml/adminhello_adminhellobackend</action>


4. 后台的布局文件

before

<adminhello_adminhtml_adminhellobackend_index>

...

</adminhello_adminhtml_adminhellobackend_index>


after

<adminhtml_adminhello_adminhellobackend_index>

...

</adminhtml_adminhello_adminhellobackend_index>


5. get url

before

Mage::getUrl('adminhello/adminhtml_adminhellobackend/doSomething')


after

Mage::getUrl('adminhtml/adminhello_adminhellobackend/doSomething')


展开阅读全文
打赏
1
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
1
分享
返回顶部
顶部