How to arrange files on symfony?
For example, I AdminBundle in a separate folder.
Are the bands correctly located? Where to place the following bandy, for example, MediaBundle .
How to arrange files on symfony?
For example, I AdminBundle in a separate folder.
Are the bands correctly located? Where to place the following bandy, for example, MediaBundle .
The best practices for application structure are described here: http://symfony.com/doc/current/best_practices/creating-the-project.html#application-bundles
Group bundles in directories if they belong to a specific part of the system, give them meaningful names, do not create divine bundles (by analogy with the anti-object god object), otherwise do what you think is right. Abstract example:
Suppose there is an application that contains two different APIs, two backends (two different admins), business logic, one front-end. Below is the structure inside the src directory:
YourProjName - DomainBundle // бандл только лишь интегрирует бизнес логику в среду симфони, саму логику в бандл добавлять не следует - Frontend - - MainBundle // главный бандл, интегрирует другие бандлы фронтенда - - Feature1Bundle // какая-то фича, которая может быть использована в других проектах или легко отключена - - Feature2Bundle // ... - Backend - - CustomersBackend - - - MainBudnle // здесь всё собирается воедино - - - UserBundle // например, расширение для FOSUsereBundle, либо интеграция пользователей из домена в данный бэкенд - - - MediaBundle // расширение медиа бандла - - CompanyBackend - - - ... // принцип аналогичен - Api - - PublicRestApiBundle // при необходимости можно разделить версии API на разные бандлы - - WhateverApiBundle If a bundle is supposed to be made public, then the requirements for complying with Symfony standards are particularly stringent. But at first you shouldn’t think about it for too long, with the experience of working in Symfony there will come an understanding where everything should be.
Source: https://ru.stackoverflow.com/questions/483262/
All Articles