自定义模块中的管理路由
所有库存的 magento 模块在后端都有 URL 路径,其中包含“admin”(默认情况下)部分。 但是我无法为自定义模块实现这一点。这是不可能的还是有目的的?
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
URL 的第一部分称为“frontName”。
Magento 只允许单个模块声明特定的 frontName。对于
admin
前台名称,即Adminhtml
。然而,Magento 1.3 引入了一种配置语法,允许您告诉已经声明了前名的特定模块,它(模块)应该检查其他模块中的控制器文件。此功能通常称为真实控制器覆盖< /a>,虽然您可以使用它来用您自己的控制器替换 Magento 中的特定控制器,但您也使用(并且应该使用它)它来设置您自己的控制器管理员控制器 安慰。这里唯一需要注意的是,如果 Magento 使用您在未来版本中已经选择的控制器名称,则在升级时需要进行调整。 (换句话说,选择唯一的名称)
如果您对详细信息感兴趣,我正在撰写有关 Magento 的 路由引擎,它将为您提供比您需要知道的更多的详细信息。
The first part of the URL is known as the "frontName".
Magento only allows a single module to claim a particular frontName. For the
admin
frontname, that'sAdminhtml
.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.