Learn how to choose between a CMS or building what you need using a PHP Framework.

A CMS or A PHP Framework? Four Questions to Ask

If you’re thinking about developing a website or an app, you will need to decide whether you want to use a PHP framework or a content management system (CMS).

Making the wrong decision can create a host of problems for your project further down the line. PHP developers from Iflexion know the recipe for wasted time and money: opting for a PHP framework like Laravel when all you need is an out-of-the-box CMS like Shopify.

In this article, we want to offer a basic checklist for deciding between a CMS and a PHP framework.

What’s the difference between a PHP framework and a CMS?

A PHP framework is a skeleton software ‘framework’ used to streamline the process of building an app or a website. It relies on the inversion of control where custom-written pieces of code are called by the framework to execute processes. A PHP framework also takes care of fundamental tasks such as URL routing and database manipulation. The sole purpose of a framework is to make developers’ lives easier by eliminating the need to build an app or a website from the ground up.

A CMS allows you to create, access and change your website's or app’s content. It interacts with your backend code to make alterations to functionality and content. Whilst the most popular CMSs, like WordPress and Drupal, are used for managing visual web content, you can just as well alter any aspect of an app’s code in any CMS.

To simplify this key difference, think of it like this: a CMS is an independent application used to build and manage the content of your backend, whereas a framework is the basis of that backend. So you can use a framework to build a CMS, but you can’t use a CMS to build an app.

Whether you’re building a static website or a complex app (or anything in between), you will likely need to rely on one or the other. Consider these four questions to help you make the right choice.

Question #1: How much control do you need?

This is the first and probably most important question that you need to ask. Short of developing an app from the ground up, the main benefit of using a framework is the unparalleled level of control and customization it offers. If you’re building a website using a CMS, WordPress for example, you’re bound by the limits of that particular system.

As the core programming code is already written for most content management systems, building custom functionalities can be time-consuming or, in some cases, virtually impossible.

However, if you don’t need a high degree of flexibility, then the cost and time savings made by using an out-of-the-box CMS can be significant. Using a CMS like Shopify to build an ecommerce store or a CMS like Vanilla to build a forum more or less eliminates the need for advanced web development.

There are also midway options for those projects that require only a certain degree of flexibility. A CMS like SilverStripe, which comprises both a content management system and a PHP framework, can be used to build customized apps and websites. However, while the development limits are quite open, a high degree of technical knowledge will still be required.

Takeaway: PHP frameworks are more flexible. However, if you do not need advanced functionality or lack development resources, opt for a popular CMS.

Question #2: How important is security?

When considering CMSs vs PHP frameworks, the security debate ‘has arguments on both sides. Whilst advocates of either approach are often sure theirs is the most secure, it’s not a case of superiority of one over the other. It really comes down to implementation. A properly-maintained framework with mediocre security features will perform better than a poorly-updated CMS with strong built-in security. According to the latest Sucuri report on website hacking trends, 44% of hacked WordPress sites were out of date at the time of infection.

The purpose of your app is another point to consider. Content management systems tend to be designed for specific uses. WordPress, for example, has been developed primarily for managing blog content like text and images. It would be a cybersecurity suicide to tailor it as a banking app.

The issue with mainstream content management systems is that their software is usually open-source and thus available for everybody to scrutinize. Third-party add-ons, especially in the form of plugins, add another layer of vulnerability. It’s important to remember, however, that bigger CMSs have lots of users and large associated developer communities, that’s why weaknesses are usually quickly identified and remedied.

If you need a high degree of customized security and there aren’t any CMSs to meet your specific needs, a framework may be the way to go. Mainstream frameworks like Laravel and Zend have built-in features to deal with the most common types of cyberattacks.

Takeaway: If your app or website has unique security needs, a framework will offer the best foundation for implementing tailor-made features. For more generic projects, the large communities dedicated to identifying weaknesses in open-source code mean that frameworks rarely offer significant security benefits over popular content management systems. For this reason, CMSs can be chosen in favor of accessibility.

Question #3: Do you want easy access?

With frameworks, unless you have a custom-made CMS, you will need to rely on your tech team for any changes. In a large enterprise, where the tech department can respond quickly to requests, this isn’t always an issue. But smaller businesses that rely on an agile structure and where employees are responsible for a range of diverse tasks will often require ease of access.

This is particularly the case with content-based websites with regular updates to their blogs. It may be necessary, for example, to manage admin permissions or change parts of an interactive tutorial.

It’s also important to provide training for employees without a technical background. For more complex CMSs, the learning curve can be significant, especially when it comes to editing content beyond the basics.

Midway systems like SilverStripe include relatively accessible user interfaces while also allowing for more advanced development. Such systems can be a good pick if you want to take a flexible approach whilst sharing responsibility across your organization.

Takeaway: CMSs are generally easier to use, but there are options for those who wish to top up ease of use with flexibility.

Question #4: How large is your budget?

An out-of-the-box CMS will invariably be less expensive than a framework. Aside from development costs, an app that’s been custom-built with a framework will have specific requirements in terms of updates, security, and any code-level changes for future versions. This isn’t the case with a content management system where updates and security features will usually be taken care of.

It’s been said that object-oriented programming can save between 20% and 60% of costs. Frameworks can add another 20%-30% savings on top of this. However, it’s important to remember that the starting figure is often very high, particularly in the case of more functional and complex apps.

Takeaway: Out-of-the box CMSs are the least expensive option.

And the Oscar goes to…

There is no clear-cut winner in the CMS vs PHP framework debate. Smaller projects will likely be able to rely on a CMS exclusively. Bigger projects, on the other hand, especially those geared toward unique and advanced functionality, will probably require the freedom that only PHP frameworks can offer. There are also midway options like SilverStripe and October CMS.

Yaroslav Kuflinski is AI/ML Observer at Iflexion. He has profound experience in IT and keeps up to date on the latest AI/ML research. Yaroslav focuses on AI and ML as tools to solve complex business problems and maximize operations.