
Symfony Basics
Installation, project structure, bundles, environments, configuration, routing, controllers
1Which command creates a new Symfony project with all dependencies for a web application?
Which command creates a new Symfony project with all dependencies for a web application?
Answer
The symfony new --webapp command creates a complete Symfony project with all dependencies needed for a web application (Twig, Doctrine, Security, etc.). The symfony new variant without --webapp creates a minimal project. Composer create-project is a valid alternative but symfony new is recommended as it automatically configures optimal settings.
2Which folder contains controllers in a Symfony 7 project?
Which folder contains controllers in a Symfony 7 project?
Answer
Controllers are placed in the src/Controller/ folder according to Symfony's standard structure. The corresponding namespace is App\Controller. This convention enables automatic autowiring and facilitates code organization. The other mentioned folders do not exist in the standard Symfony structure.
3What is a Bundle in Symfony?
What is a Bundle in Symfony?
Answer
A Bundle is a reusable package that groups code and resources (controllers, templates, configuration) around a specific feature. It can be shared across multiple Symfony projects. Third-party bundles are installed via Composer and registered in config/bundles.php. In modern Symfony, bundles are primarily used for third-party libraries.
Which file contains the list of active bundles in a Symfony project?
What are the three default environments in Symfony?
+22 interview questions
Other Symfony interview topics
Modern PHP (8.1+)
Routing & Controllers
Twig & Templates
Doctrine ORM Basics
Symfony Forms
Data Validation
Dependency Injection & Services
Security & Authentication
Doctrine Advanced
API Platform
Serializer Component
Events & Event Subscribers
Console & Commands
Messenger Component
HTTP Client
Cache & Performance
Workflow Component
Testing Symfony
Mailer Component
Translations & i18n
EasyAdmin Bundle
Symfony Architecture
Performance & Optimization
Security Advanced
Custom Bundles
Microservices with Symfony
Real-time & WebSockets
Deployment & DevOps
Master Symfony for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free