symfony2 chained selectors

后端 未结 3 1888
無奈伤痛
無奈伤痛 2020-11-30 19:48

I have three entities: Country, State and City with the following relationships:

When creating a City, I want two selectors, one for the Country and one for

3条回答
  •  一向
    一向 (楼主)
    2020-11-30 20:10

    Since your link to this approach is down i decided to complement your excelent answer so anyone can use it:

    In order to execute the following javascript command:

    url: Routing.generate('state_list'),
    

    You need to install FOSJsRoutingBundle that can be found in here.

    ATENTION: in the read me section of the bundle there are instalation instructions but there is something missing. If you use the deps with this:

    [FOSJsRoutingBundle]
    git=git://github.com/FriendsOfSymfony/FOSJsRoutingBundle.git
    target=/bundles/FOS/JsRoutingBundle
    

    You must run the php bin/vendors update before the next steps.

    I'm still trying to find out what route is needed in the routing.yml for this solution to work. As soon as i discover i will edit this answer.

提交回复
热议问题