Admin route in custom modules

谁都会走 提交于 2019-12-11 12:37:09

问题


All stock magento modules have URL path in backend which has 'admin' (by default) part. However I was not able to achieve that for a custom module. Is this not possible or done on a purpose?

Thanks


回答1:


The first part of the URL is known as the "frontName".

http://example.magento.com/frontName/controllerName/actionName

Magento only allows a single module to claim a particular frontName. For the admin frontname, that's Adminhtml.

However, Magento 1.3 introduced a configuration syntax that allows you to a tell particular module that's already claimed a front name that it (the module) should check additional modules for controller files. This feature is often called real controller overrides, and while you can use it to replace a particular controller in Magento with your own, you can also use (and should use it) it to setup your own controllers for the admin console. The only caveat here is if Magento uses a controller name that you've already picked in a future version, you'll need to adjust things when you upgrade. (in other words, pick unique names)

If you're interested in the details, I'm in the middle of writing a series on Magento's routing engine, which will give you more detail than you'll ever need to know.



来源:https://stackoverflow.com/questions/7521620/admin-route-in-custom-modules

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