How to share a Symfony2 model with several projects

后端 未结 2 1654
一生所求
一生所求 2021-02-07 11:53

We are creating a SaaS that monitors certain assets. This means it takes in data, saves it, and displays it in a webinterface.

For this, we have a few components that we

2条回答
  •  说谎
    说谎 (楼主)
    2021-02-07 12:47

    What I am currently doing is the first option: create a separate bundle for your entities. That's where I store fixtures, entities, forms and entity-related tests.

    A bundle does NOT need to have routing, controllers, views etc. I've actually seen a blueprint bundle, and all it does is ship blueprint-css resources with it so they can be easily reused in projects.

    As for adding models to the app directory... I wouldn't like that. I see the app directory as a place where all the configuration should be. Even though you can override views under app/Resources, whenever I want to override something I create a new bundle.

提交回复
热议问题