douxia2137 2018-01-29 14:59
浏览 11
已采纳

Sylius定制注册控制器

Very simple question that makes me mad. I write in main file for routing app/config/routing.yml

sylius_user_registration:
    path: /register
    defaults: { _controller: MyBundle:Registration:register }
    methods: [GET, POST]

And my controller

class RegistrationController extends Controller
{
    public function registerAction(Request $request)
    {
        var_dump(111);die;
    }
}

And when I visit myshop.loc/app_dev.php/register, I see sylius register page. There is a simple customization. What I make wrong?

P.s.

  • tried to clear cache

  • routing file is declared in app/config/config.yml

  • 写回答

1条回答 默认 最新

  • dongzhang7382 2018-01-30 05:32
    关注

    Sylius Bundles are registered first, therefore sylius routing is registered first and yours is ignored.

    If you need to modify behaviour of sylius.controller.customer:createAction, instead of overloading routes, you need to extend customer controller via sylius resource system.

    http://docs.sylius.org/en/latest/customization/controller.html

    http://docs.sylius.org/en/latest/book/architecture/resource_layer.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化