在构建自定义的magento模块时,我发现以下内容:
xxx/view/id/4=404秒xxx/index/view/id4=正确路由
有没有办法从路由中删除初始索引?
标准Magento URL匹配至少需要三个部分:
site.com/catalog/product/view/id/4 <--- params
^ ^ ^
| | `----------- action
frontname--´ |
controller path
假设索引。您可以很容易地制作一个ViewController
,并像当前的IndexController::viewAction()
一样使用indexAction()
。重复该模式。
还有其他几种可能性,包括重写、自定义路由器类等。