Thomas Schedler
Thomas Schedler
Co-Founder & CEO – Sulu GmbH
Sulu's technical Master Blaster. Tries to keep our code on it's toes and to master Heston Blumenthal recipes on his very seldom free days.
@chirimoya

Why Sulu CMS Is A Natural Fit for Symfony Projects

Choose your CMS wisely.

You will enter a long-term relationship with your content management system (CMS), as it powers your web presence for years to come. Your CMS of choice therefore needs to align with your development philosophy and project requirements.

If you already build or run Symfony apps, then Sulu CMS is a natural fit. Sulu is an open-source CMS deeply rooted in the Symfony ecosystem. In this article, we will explore what this means in detail and why this is a perfect foundation for building exceptional web applications.

The philosophy behind Symfony

Symfony is one of the most popular PHP frameworks for building websites and web applications. It consists of prefabricated software components and a methodology of putting these components together to efficiently form a robust application. The framework is built upon Symfony Components, a set of reusable building blocks for all kinds of tasks.

Symfony’s philosophy centers on several values that are fundamental to modern website and web application development:

  • Modularity and reuse: The components Symfony is built on are designed to be decoupled and freely reusable, even outside the Symfony framework.
  • Performance: Gone are the days of throwing more CPU at a slow application. Symfony supports building performant applications from the ground up.
  • Interoperability: As an open-source project, Symfony fosters interoperability between applications and components.
  • Developer productivity: A framework’s reason for being is to speed up application development. Symfony comes equipped with tools and features designed for creating an efficient development workflow.
  • Building robust, scalable applications: Symfony was designed with scalability in mind. As business needs evolve, Symfony applications can adapt by integrating additional bundles or scaling existing components.

The modularity aspect is worth a closer look. Symfony has the concept of Bundles. A Symfony bundle is a functional module (a code library or a full application) that can be added to the framework and combined with other bundles. The Bundle concept plays a central role in the Sulu architecture.

The anatomy of Sulu CMS

Sulu is a Symfony application. It is built upon the open and flexible Symfony framework and will feel immediately familiar to Symfony developers. Sulu does not only use particular components; it is the whole, full-stack framework. Sulu has Symfony’s file system structure, and tasks like debugging work the same as in standard Symfony.

The only Sulu-specific exception is Sulu’s admin view, which poses stricter requirements for adding custom entities or controllers.

Sulu is basically a set of Symfony Bundles

Bundles deliver all the flexibility and cross-project reusability of Symfony. Sulu is built of bundles to achieve the utmost modularity. Even the core Sulu application is a set of bundles. So if you have built a Symfony application and want to integrate a CMS, Sulu is a natural fit.

Besides the core bundles, Sulu comes with a range of extra bundles that can add more functionality as needed. For example, the FormBundle adds support for creating dynamic forms in the Sulu Admin UI. Consider Sulu a collection of tools for constructing a website. This approach is much more flexible than monolithic architectures.

Because Sulu is essentially a set of Symfony bundles, there are no “hidden features” or unfamiliar ways of doing things. Sulu is a plain Symfony application.

Sulu supports Separation of Concerns (SoC)

The idea of modularity repeats in the higher levels of the architecture. Sulu keeps separate concerns separate. For example, the page structure is configured as an XML document, while a Twig template takes care of the visual appearance. Find out more about how Sulu separates concerns to achieve flexibility through structure.

Sulu utilizes Symfony’s MVC support

Another aspect that Symfony developers will be very comfortable with is that Sulu adheres to Symfony’s Model-View-Controller (MVC) paradigm. Developers can easily apply their existing Symfony knowledge and best practices to Sulu development, streamlining the learning curve and enhancing productivity within the team.

Sulu uses CMF for dynamic routing

Symfony CMF (Content Management Framework) is a routing component that provides a chain router and a dynamic router. The chain router manages a prioritized list of routers and dispatches incoming requests to the list of routers, one by one, until a router can handle the request. The dynamic router is designed to handle large numbers of user-generated routes that can be loaded, for example, from a database.

If you know CMF, you know how Sulu routes requests.

Sulu configuration is standard Symfony configuration

If a CMS has a database as its central storage for content, why not store the CMS configuration in the database as well?

The idea might seem logical, but it has drawbacks. Accessing the configuration requires a user interface specifically designed for this purpose. Database tables require more effort to back up or copy to other locations.

Sulu therefore does not store configuration in the database. Rather, it makes use of Symfony’s bundle configuration files. (See also, “Configuration belongs in code, not the database” in Understanding Sulu and taking your first steps.) This is not only an established way of storing configuration in Symfony, it is also developer-friendly, since no specific UI is required to edit the configuration. The version control system used for development can also take care of versioning the configuration files. Sulu takes these developer needs into account and provides UI-based configuration to content managers and CMS administrators only.

How the Sulu concept gives you a competitive edge

So far, we have seen the extent to which Sulu adheres to Symfony standards and best practices, but apart from technical details, what else do we gain?

The Sulu concept has, indeed, a number of advantages.

A great developer experience out-of-the-box

Symfony developers are immediately familiar with Sulu’s architecture and concepts. With Symfony as its foundation, Sulu allows for rapid development by leveraging Symfony best practices. Symfony developers will love the low learning curve, managers will appreciate the resulting short time-to-market.

Sulu also cuts a lot of work by providing an administration UI for managing content. When developers add new content types, they don’t have to write the administration interface for these content types from scratch but rather can extend the existing admin UI, saving a lot of time and effort.

Sulu is future-proof and maintainable

On the organizational level, Sulu is ready for a long and stable future. Sulu is backed by three entities: Sulu GmbH, the Sulu community, and the Symfony community. Sulu’s open-source nature gives it a natural competitive advantage over closed-source, proprietary solutions.

On the technical side, Sulu’s codebase is built following Symfony’s high standards, resulting in great maintainability and readiness for future extensions. Symfony is built with a long future in mind. Symfony’s Long-Term Support (LTS) releases reduce maintenance efforts for deployments that shall remain stable over a long period of time. At the same time, the Symfony Backward Compatibility Promise greatly increases the likelihood of running old code with newer (minor) versions of the Symfony framework.

Sulu fully supports Symfony 5, 6, and 7 today and is committed to staying current with the latest Symfony changes.

The knowledge from a large community is at your disposal

Sulu has an active community of users and contributors. And since Sulu is a Symfony application, many requirements and problems that arise during development can be addressed the Symfony way. This means that the large Symfony community is here to help as well. So Sulu CMS developers have access to a thriving community and vast resources for learning and troubleshooting.

On top of this, Sulu GmbH offers consulting, training, and implementation services to help you kick-start your CMS project.

What else can we say? Try it for yourself.

A CMS like Sulu, which is based on open source and an established application framework, has many advantages. It avoids vendor lock-in by adhering to Symfony standards. Extending the system is ridiculously easy for any Symfony developer. As Nils Langner, founder of Leankoala, explains, “I knew how Twig and Symfony worked, so I could read the examples straight away. For me, whether I write a controller for Leankoala in Symfony, or for Sulu, makes no difference. I could use all the mechanisms I had already learned.” The open-source concept creates an ecosystem of ongoing innovations and a robust support network.

Sulu CMS is indeed an excellent choice for building modern web applications.

Try Sulu for yourself, or contact us for a demo. We’re happy to show you Sulu’s extraordinary features.