dqrdlqpo775594 2014-06-25 10:24
浏览 26
已采纳

在Symfony2.0中,我想在使用app.php(prod env)时在router.yml中禁用一些url?

When using app_dev.php, there are some useful url for me to debug project. Such as

check_debug:
    pattern: /check_url1
    defaults: {....}

check_debug_and_prod:
    pattern: /check_url2
    defaults: {....}

check_prod:
    pattern: /check_url3
    defaults: {....}

I want to disable 'check_debug' when I using app.php(prod env), and disable 'check_prod' when I using app_dev.php(dev env), and keep 'check_debug_and_prod' both when using app.php or app_dev.php.

How to config in SF2?

  • 写回答

2条回答 默认 最新

  • dsfhd78978 2014-06-25 10:27
    关注

    You can have multiple routing.yml files for different environments. E. g. app/config/routing.yml, app/config/routing_dev.yml

    You can have different routing files for different environments:

    1. Create src/AAA/Bundle/CCBundle/Resource/config/routing.yml
    2. Create src/AAA/Bundle/CCBundle/Resource/config/routing_dev.yml
    3. Include src/AAA/Bundle/CCBundle/Resource/config/routing.yml in app/config/routing.yml
    4. Include src/AAA/Bundle/CCBundle/Resource/config/routing_dev.yml in app/config/routing_dev.yml
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器