匹配的路由规则使用默认模块而不是指定模块
由于某些奇怪的原因,当在我的 Symfony 项目中匹配定义的路由时,正在使用默认模块和操作。如果有人能帮助我解决这个问题,我将非常感激,因为我已经把头撞在桌子上一段时间试图弄清楚了。
route.yml
supplies_similar:
url: supply/similar/:id/page/:page
param { module: supplySimilar, action: index }
查看代码
<?php echo link_to($page, '@supplies_similar?id='.$id.'&page='.$page); ?>
日志消息
将 /supply/similar/2087641/page/2 的路由“supplies_similar”(/supply/similar/:id/page/:page)与参数数组('module' => 'default', '操作'=>'索引','id'=>'2087641','页面' =>“2”,)
For some odd reason, the default module and action are being used when a defined route is being matched in my Symfony project. I would really appreciate it if someone could help me with this as I've been banging my head on my desk for a while trying to figure it out.
route.yml
supplies_similar:
url: supply/similar/:id/page/:page
param { module: supplySimilar, action: index }
view code
<?php echo link_to($page, '@supplies_similar?id='.$id.'&page='.$page); ?>
log message
Match route "supplies_similar" (/supply/similar/:id/page/:page) for /supply/similar/2087641/page/2 with parameters array ( 'module' => 'default', 'action' => 'index', 'id' => '2087641', 'page' => '2',)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查你的routing.yml中的缩进,不要忘记“param”后面的冒号:
Check your indentation in your routing.yml and don't forget the colon after "param":