In this article, we will look at seven great, lightweight PHP frameworks. Each framework has been tested for speed and useability. We will be looking at the following frameworks: Cakephp, CodeIgnitor, Symfony, yii, RainFramework, Doophp, and Kohana.
PHP frameworks allow you to quickly develop web applications and websites. In an application setting, there are two types of people that will be working on the project. The first is the web designer, whose primary concern and interest is the look and feel of the website (the “presentation”). The second is the PHP developer/programmer that writes the PHP code to do the logic and database communications.
Using a framework, each team will be working separately at the same time to attain the project objective to complete the website. PHP frameworks that rely on MVC (Model-View-Controller) architecture makes it possible for the entire website application to be broken down into 3 modules. Each of these modules can, in turn, be easily updated, managed and improved upon by each team without necessarily interfering with other modules.
These 3 modules handle the following web development/designing tasks:
Model - data handling (database communication) and management section of the web application.
View – the view is the design layer of the website.
Controller – the business logic and PHP code to accomplish the website functionality/features.
It is not necessary to use a PHP framework in every PHP website project; however, using a PHP framework does have some benefits, such as:
1.) Separating Logic from Presentation – makes the website source code easier to maintain, manage and update.
If you need to change the templates, you will only be dealing with the markup affecting the design and not the PHP code that controls the logic. This implies that the design is “clearly” isolated from the PHP code.
2.) Speeding up the development of web applications - a framework already provides all the necessary elements of a website. These include sessions, HTML sanitization/input validation, database interfaces, etc. It only requires a very simple configuration/installation (like a copy and paste operation) and your project can be completed within a reasonable time frame. Working without a framework can cost a lot of time in the development process, because everything must be created from scratch.
This article will examine 7 great and lightweight PHP frameworks released in open source.
Criteria of a Good PHP Framework
There are so many PHP frameworks that it can be hard to keep track of them all. Some are already very popular, while others are relatively new and unknown. Whatever the case, when selecting a good PHP framework, make sure it satisfies the following criteria:
Lightweight – the framework files are light and reasonable in size. In this case, Zend framework is too heavy to be classified as lightweight.
Flexibility in hosting – is it OK to install the framework normally in a shared hosting environment or does it require a VPS to operate efficiently? Most lightweight PHP Frameworks operate very well with shared hosting although they have different speed performances which will be examined thoroughly in this article.
Security - are inputs thouroughly sanitized?
PHP supported versions – does it support the latest PHP versions?
Database support – does it support MySQL or SQLite? These databases are available in most hosting companies using PHP.
WYSIWYG Design support – “What you see is what you get” is important to ease the design of HTML templates.
Documentation – does the framework already have complete documentation for its users?
Of the seven criteria, this article will examine only the speed and performance. The following are the seven PHP frameworks to be tested: