PHP is by far the most popular server-side programming language to create web applications. In the past years a lot of frameworks for PHP has emerged. PHP frameworks offers developers a platform to create more complex, secure, and standardised web applications in the fasted way possible. There are so many PHP frameworks available and each of them is different as it targets developers with different skill levels, hosting platforms, and complexity.
One of my biggest challenges is: “Which one should I learn first?” then also: “Is it worth it?” To choose the right framework to learn depends on the type of applications you are going to, or want to, develop.
As with all things in life, there are pros and cons to each framework, here is a quick summary of the pros and cons for some of the most popular PHP Frameworks.
Laravel
Laravel is the most popular PHP framework at this time as it is designed for rapidly building web applications using the MVC design pattern. Some of the most noted features of Laravel is that it comes with a lightweight templating ening, a packaging system, unit testing, RESTful controllers, and it handles noSQL structures easily.
[bs_row class=”row”]
[bs_col class=”col-sm-6″]
Pros
- The file structure and code is very organised and easy to understand
- Utilises the MVC architecture
- Built in unit testing
- The documentation is thorough and the best of any of the frameworks
- Overloading capabilities
- A lot of functionality in the core
[/bs_col]
[bs_col class=”col-sm-6″]
Cons
- Laravel does not work on shared hosting environments
- The amount of queries performed is very high
[/bs_col]
[/bs_row]
Symfony
As their website states: “Symfony is a set of PHP Components, a Web Application framework, a Philosophy, and a Community — all working together in harmony.” Symfony has been described as a very stable, high performance, well documented, and modular project. Symfony is backed by the French SensioLabs, and has been developed by them and it’s community.
[bs_row class=”row”]
[bs_col class=”col-sm-6″]
Pros
- High performance, due to byte code caching
- Stable
- Well documented, maintained, and supported
- Very good support and is very mature
[/bs_col]
[bs_col class=”col-sm-6″]
Cons
- While the documentation is good, there is a steep learning curve.
- Companies are moving to MVC Framework architectures and Symfony2 does not support MVC.
[/bs_col]
[/bs_row]
Codeigniter
Codeigniter is an ideal framework for rapid application development. It’s a lightweight, low-hassle, framework with a small footprint that can be installed just by uploading it directly to your hosting. No special command line or software installation is required. Upload the files and you’re ready to go.
[bs_row class=”row”]
[bs_col class=”col-sm-6″]
Pros
- It is very developer friendly, as it doesn’t need any special dependencies or supports
- It has the ability to use normal web hosting services well
- Uses standard databases such as MySQL
- Outperforms most other non MCV frameworks
- Very well written documentation and long term support
[/bs_col]
[bs_col class=”col-sm-6″]
Cons
- It doesn’t have namespaces, however this can speed up the application
- Not as friendly towards unit testing as others
- Few libraries that are built inside the framework
[/bs_col]
[/bs_row]
Is it worth using a framework?
Although frameworks is a very good tool to use, it does come with some cons. The biggest one is that it is developed by a community. You may think this is the best reason to do so, but in reality there will be thousands of people who know exactly what your application is based on and with that, if there are any vulnerabilities anyone can exploit your systems.
On the other hand, if you are creating systems you should look at the type of system you are building and see what is the best possible way to do so. Evaluate firstly if a framework is a good option for you, and if it is read up on the frameworks available and see which one is designed to fulfill your needs.