dourang6423 2014-01-21 03:23
浏览 33
已采纳

Symfony,routing.yml不起作用

I have a project in sympfony. Im trying to add a new page, and i have done usual steps, but nothing seems to work. I have added the following to src/ITWB/FrontBundle/Resources/config/routing.yml:

itwb_front_abc:
pattern: /abcCenter
defaults: { _controller: ITWBFrontBundle:Footer:abcCenter }

In my src/ITWB/FrontBundle/Controller/FooterController.php i have added this:

public function abcCenterAction() { 
return $this->render('ITWBFrontBundle::test.html.twig');
}

But it's not working. I have tried putting and "echo" inside the action, and it isnt displaying, so, the problem is in the routing, domain.com/abcCenter its not being recognized. I have also tried with other names and it's the same.

What can i do ? Thanks

  • 写回答

3条回答 默认 最新

  • dongqing314511 2014-01-21 11:30
    关注

    Take care of indent, like Wouter J says.

    You can access abcCenter via domain.com/app_dev.php/abcCenter (not domain.com/abcCenter) if your website is running local, otherwise you have to clear cache:

    php app/console cache:clear --env=prod --no-debug
    

    How to deploy a Symfony2 application.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭