Reliability and maturity
Symfony enjoys a solid reputation as one of the most reliable and successful PHP frameworks.
Published on 04/17/25
Since Drupal 8, Drupal has undergone a veritable architectural transformation. Gone are the days of the monolithic CMS coded in procedural, unstructured PHP. Based on Symfony components , Drupal has adopted a modern structure based on dependency injection, explicit routing, services, events and testability.
This hybridization is not just a technical modernization: it opens the CMS up to a much wider scale of use, to the point of becoming an application framework for complex custom projects.
Drupal is an open source PHP content management system . It powers over 1.7 million websites.1
Although statistics show a lower overall market share than for other CMS (Wordpress, Joomla, Wix...), Drupal holds just over 6% of the top 10,000 websites1. It is used bygovernments such as France andAustralia, the European Commission,UNESCO, SNCF and even Tesla.
Symfony is an open-source PHPframework. In simple terms, it's like a big "toolbox", bringing together numerous components that facilitate the development of web sites or applications.
It's one of the most popular and powerful PHP frameworks on the market. The number of downloads of its components has exceeded 29 billion2.
Symfony joined Drupal since version 8 in 2015 with Symfony 3. Today, Drupal 11 uses Symfony 7.
Symfony enjoys a solid reputation as one of the most reliable and successful PHP frameworks.
Symfony is above all a collection of decoupled, interoperable PHP components designed according to PSR standards .
It enables the developers in its community to develop faster, with no need to reinvent the wheel, and encourages the standardization of best practices.
It is extensively tested and maintained by a large community. As a result, it has excellent documentation.
Symfony is one of the few frameworks with commercial support.
That's all well and good, but what does it mean for developers?
Drupal uses the following Symfony components, for example:
Some other components, such as Twig and Doctrine, are not mentioned here, but are a great step forward for Drupal.
As Symfony is based on OOP and modern PHP standards (PSR, namespace, autoloading...), Drupal has abandoned its old procedural model for clearer, more organized classes. This makes Drupal much more flexible, testable and maintainable. The core of Drupal has become more modular and interoperable.
The routing system is much more powerful and easier to read. It allows you to link a URL to a controller while managing permissions and response format.
Example of a route :
my_module.index:
path: '/my-path
defaults:
_controller: '\Drupal\my_module\Controller\MyController::index'
requirements:
_permission: 'access content'
Instead of using procedural hooks, we can now listen for (and create) events. A module can hook at any point in the request lifecycle, thanks to theEventSubscriberInterface. Modules become less coupled, more readable and easier to test.
However, it's important to understand that procedural hooks are still used for certain native Drupal functions (form alteration, theme preprocessor, etc.).
Symfony works with service containers. Classes depend on each other throughdependency injection.
Services can then be injected into controllers, forms, plugins and so on. This makes the code much more modular and testable.
Functionalities no longer have to be stored in Drupal's ancestral.module file, but can be organized in services. Any Design Pattern can be used as required.
Dependency injection makes code more maintainable, modular and extensible. Code is easier for developers to read, since dependencies are visible right from the constructor. You don't have to worry about object lifecycles, the Symfony container takes care of that.
Example of instantiating a service in a file: my_module.services.yml
services:
my_module.my_service:
class: Drupal\my_module\Service\MyService
arguments: ['@logger.factory']
Example of service implementation in a class:
public function __construct(
public readonly MyService $myService
) {}
Gone are the days of procedural *.tpl.php and spaghetti-like PHP code in templates! The Twig engine makes templates easier to read, maintain and inherit.
But that's not all! PHP is no longer allowed in templates, so security has been improved. There's a real desire to separate logic and HTML, much to the delight of back-end developers!
Spoiler Alert: Twig functions can still be created using the TwigExtension to add a little logic while respecting the logic/template separation. Be careful, however, to limit their use to avoid creating a gas factory. These functions must not replace preprocess(), controllers or plugins. Templates should only be used for display purposes.
Thanks to Symfony, Drupal has rethought its entity management system using certain Doctrine components. Drupal doesn't useORM because its entities are dynamic and not rigidly mapped to classes/tables, and some entities are not in databases but rather YAML configurations. However, it has its own mini-ORM using EntityAPI. Drupal therefore offers a version inspired by the modern ideas of Doctrine, but with its own twist:
$node = $this->entityTypeManager
->getStorage('node')->load(42);
$title = $node->getTitle();
Or query via EntityQuery :
$nids = $this->entityTypeManager
->getQuery
->condition('status', 1)
->execute();
In concrete terms, it's object-oriented, typed, injectable and extended by plugins, BUT it's not Doctrine ORM.
What's more, Symfony's structural rigor makes it possible to better profile, optimize and segment responsibilities:
Symfony components have been designed with efficiency in mind, and Drupal has made considerable progress in terms of performance thanks to these components.
The integration of Symfony into Drupal isn't just a major upgrade, it's a paradigm shift that transforms the CMS into a modern, extensible, testable application base aligned with the new PHP standards. For more complex and specific projects, this hybrid architecture is a real lever for quality, robustness and scalability. It also enables Symfony and Drupal skills to converge within the same tech team.
Where it wasn't possible to do headless with Drupal, today anything is possible. The site you're reading this on is headless Drupal!
Are you interested in our projects and our expertise? Why don’t we have a chat?
Your browsing inspires our AI to offer you tailor-made content.
For eco-design, let’s moderate its use.