Symfony 真正的关系,不是“控制器 + ORM”
而是:
HTTP 世界
├── HttpFoundation
│ ├── Request
│ └── Response
│
├── HttpKernel
│ └── 驱动整次请求穿过城区
│
├── Routing
│ └── 把请求送到正确窗口
│
├── Security
│ ├── Authentication
│ ├── Firewall
│ └── Authorization / Voter
│
├── Controller
│ └── 薄胶水层,协调而不包办
│
├── Service Container
│ ├── Autowiring
│ └── Autoconfiguration
│
├── Business Code
│ ├── Service
│ ├── Repository
│ ├── MessageHandler
│ └── EventSubscriber
│
├── Data Layer
│ ├── Doctrine
│ ├── Entity
│ └── Migration
│
├── Input / Output
│ ├── Form + Validator
│ ├── Twig
│ ├── JsonResponse
│ └── AssetMapper
│
└── Around It
├── Messenger
├── Console
├── Profiler
├── Cache
└── Flex如果你能把这张图在脑子里复述出来,Symfony 就不再是一堆零碎知识点了。