Guide to 24 PHP Frameworks (Part 2)
In Part 2 of this series, we look at several great PHP frameworks and a few PHP compatible CRMs to help you choose the framework for your next project.
Join the DZone community and get the full member experience.Join For Free
follow the series
this blog post is the second part of " the definitive guide to your next php framework. "
didn't read it yet? you can check it out here .
the following parts will be published during the next couple of weeks or you can click the link below to download the full version of the kindle book " the definitive guide to your next php framework ."
if you have read the first part of this article, you should be confident when your colleagues ask you what a framework is and why php has so many of them.
if you are new to this topic and you want to scale up your web development skills, or you are a veteran and you would like to explore more choice out there, below you will find several others framework reviews that will let you decide which one to use next.
table of contents
i need to be honest here, this was the first framework i used, and, as they say, you will never forget your first love.
when i was first introduced to an mvc environment from php developers using other frameworks, it was a struggle trying to understand where to put the code, and why there was the need for that extra effort arranging php, mysql, and html pages in different parts of the project folder.
then i discovered codeigniter, specifically, i read the first 4-5 pages of its documentation.
suddenly everything became clear and, in a couple of hours, i was able to recreate functionalities and properly divide up code using the framework, and it helped me a lot when i learned more advanced frameworks.
codeigniter is quite old, it released initially in 2006, but, after being taken into the stewardship of the folks at the british columbia institute of technology, it still gets updated often.
in fact, at the time of my writing, the latest version (3.1.8) was released at the end of march 2018.
the most important characteristics of codeigniter are the lightness and the speed at which it procesess data.
it's the framework i'll be discussing in this post that looks the least like a framework.
compared to the other php frameworks, codeigniter has a clear and easy to understand file structure, very detailed documentation, and lots of users and companies that still use it and can help provide support.
it is definitely the way to go if you feel ready and you have enough experience with vanilla php.
with this framework you are ready to take the step further.
foreword: drupal is not an actual php framework, it is more of an advanced cms or, even better, a cmf (content management framework).
drupal was founded in belgium by dries buytaert, who developed a messaging board to stay in touch with his groups of friends.
its first domain was drop.org and its popularity increased so quickly that in january 2001, he decided to officially launch the website after changing its name to drupal.
by the way, drupal means “drop” in dutch.
unlike other popular cmss based on php, drupal requires more time to be fully understood.
it has a bigger learning curve, but the response of several developers was that, after a while, the flow was very smooth.
it runs on the majority of php web servers such as apache, nginx, and microsoft iis.
it also supports the most important databases, like mysql, mariadb, postgresql, sqlite, microsoft sql server, oracle, and mongodb.
the php code is arranged in modules, and they can be enabled and disabled depending on the user choices.
the main module that builds the heart of the framework is called core,
this core can be enlarged by installing the extension developed and available on drupal.org.
right now for example, there are more than 38000 free modules available, thus everything you need is already there.
like the backend, even the front-end could be improved and, just like modules, there are several themes that can be enabled.
it's also reliabile. having been founded almost 20 years ago, there has been a lot of time to improve and create a robust and secure product.
it is also perfect for a wide range of different projects, from websites to blogs and forums to e-commerce and social networks.
they can be scaled out just by adding the necessary modules.
there is also a continually growing community that creates and deploys tons of resources on a daily basis.
in conclusion, it is a very good cms and if you have time to to learn it, it will be time well invested.
fat-free php framework
fat-free is a micro-framework created by bong costa, a filipino web developer and consultant.
as you can probably glean from the name, the key to a micro-framework is in its size.
it consists of only the bare minimum code that allows your project to run without adding any unnecessary structure.
there are multiple advantages in using this kind of skeleton.
the weight of the project. in fact, fat-free is less than 55kb, and it has a very easy learning curve. for the developer, this means no wasting time learning how things work and so you can put all your time into coding.
fat-free requires php 5.3 or higher and supports both sql and nosql databases. it also has an orm built-in.
among the key features, it allows routing and has a good template engine connected with the views.
even though there are good reasons to use a micro-framework, you have to consider that this could be seen as a limitation when the project needs to be scaled or if there is more than one web developer working on it.
another little limitation is that fat-free does not come with a defined structure but you need to create it according to your needs, and this could be intricate if at the beginning.
one of the most interesting (in my opinion) php frameworks available is fuel.
it was created by several web developers with lots of years working and building php frameworks — dan horrigan and philip sturgeon (famous for their contributions to codeigniter), among them.
fuel seemed to be a good mixture between codeigniter 3.x and kohana 2.x taking the best parts and improving on each of them.
the result was a very fast structure to work with.
it was designed to have full support of the hierarchical model view controller principle, which means that the selected code can be used in several pages across the entire project — just think of a shopping cart or blog posts.
let's forget the presence of the presentation model, also called viewmodels. it basically adds another level between the views and the controllers.
the idea of the file structure for fuelphp was copied from kohana and improved upon, a wise use of namespaces and autoload which allows the calling of class to happen clearly faster than the parents.
it also came with two packages pre-installed, activerecord and oil, the latter of which is a very useful command line utility.
fuelphp has been developed by people that surely know what they are doing and it took one of the best features of kohana (its file structure) and mixed it with codeigniter, which, as seen above, has been a masterpiece for a decade.
but now, with the release of php 7, it's starting to show its age.
the downside of it may be that the community has never grown that much, thus it is very difficult to find the support and answers to questions from other developers.
phil sturgeon was really kind to reply to my email when i asked for information about this framework.
he said that the peak of the effort of the development team was in the years 2011-2012, and even though the code is still available online, the project was officially abandoned in 2015.
he also linked me to a blog post he wrote, dated january 2011, in which he was introducing fuelphp to the world.
i highlighted what i thought was the most important information above, but if you want to check his post out, here is the link:
sturgeon's introducing to fuel php
another external reference he sent me was a blog post written by dwayne charrington, in which he carefully compared the main characteristics of fuel and codeigniter.
phil never rests, and he gave me a list of several projects he is currently working on. he is now mainly working at wework, a new york based company.
among his projects you can find:
all of them have repositories on github.
he is creating tooling to help users with api specifications and api interactions in general.
here is a link to a few articles for whoever wants to learn more about the topic.
another fascinating framework, at least for its composition, is gyroscope.
developed by antradar, it has been around for a while, in fact, its first release is dated to more than 9 years ago.
it supports 5.4 and the newest versions of php and, among its pros, there is the size, which is less than 200 kbs and thus, its speed.
unlike the other frameworks we have just seen, gyroscope uses anlchh architecture and not the more popular mcv.
in this architecture, a div tag with a unique id is populated using previously chosen data.
this data invokes the client that sends an ajax request to the server side. then the php does its stuff like create, delete, etc., and updates the view.
this makes the path equal to an http request which is good for performance and debugging.
some problems you might encounter if you choose to use gyroscope is that there is low or no support at all, the documentation in the official website is out-of-date, alongside a community that has never really grown.
my last thought is that if you want to explore more in the php world and learn about lchh, it is fine to give it a shot.
but, at the same time, be aware that there are more advanced frameworks out there.
released in july 2003, jamroom is another cms.
now in its sixth version, it was developed by talldude networks and is licensed with a mozilla public license.
jamroom is a very different product from the others you are seeing here.
it is composed by a module architecture that permits the structure to increase or decrease its functionality.
the other part of jamroom is its skin, which allows you to change the features and look of the website.
everything inside it is either a module or a skin.
a relevant event is the fact that it ran on flash until version number 5, which carried some issues regarding mobile responsiveness.
nowadays, the problem has been successfully solved and all the multimedia data uploaded is then converted and available in several formats.
here is another content management framework.
this is an lgpl licensed project, which means that the external developers can enhance the code by adding and improving implementation and features.
kajona was created in 2004. the second version was deployed in 2005 immediately followed by the version 2.1 in 2006. at the moment, this cms is a sound framework arrived at its sixth version.
the system is separated it two main sectors: the backend, which is the part used to maintain the website, and the portal, which is used to show the content.
this portal has built-in in-page editing functionality.when hovering on an editable element it is possible to update its contents and the result will be seen on the fly.
from a web developer’s point of view, the architecture looks like a normal mvc with the three distinct layers.
kajona supports mysql, mariadb, postgresql, oracle, and sqlite. it also provides a template engine to render the content in the front-end.
to sum up, this is a very solid cms built in a way that its code can be tweaked and edited in a very smooth way.
it is not mainstream, so you will not find a lot of support, but it comes along with a good documentation.
if you need a similar product and you do not want to use wordpress, it is worth giving a shot.
i have already mentioned this framework when i was describing fuelphp above.
kohana was, yes i wrote was, a very good and a very unlucky framework.
its development started at the end of may 2007, from the plan of some codeigniter members and its first name was blueflame.
the first official version was released a couple of months later, without any documentation.
after some scrambling by the internal team, the second version was released in november of the same year. at that time it was written in php 5.0.
the third and last version of this php framework was released officially on september 9, 2009, and the last update, 3.3.6, was released july 25, 2016.
kohana was formally deprecated on july 1, 2017.
several intents of revival have been tried, at the moment the closest heir is koseven.
i have spoken with chema garrido. he is the frontman of koseven and he said that the framework is a compatible replacement of kohana, which allows users that do not want to migrate for kohana to keep the application bug-less and up-to-date thanks to post security fixes and compatible with the latest versions of php.
he also advised using a more modern product; like me, he is a fan of laravel, which you will read more about it in the next section .
here is the showpiece of the list.
from my point of view, laravel is without any doubt the most interesting framework for php.
its growth and the list of features are simply unbelievable.
created by taylor otwell as an experiment of improving codeigniter, laravel's first release occurred on june 2011.
it wasn't a real mcv because of the lack of controllers but had dozens of internal features such as authentication, sessions, routing, and localization.
several enhancements were brought by the second version of laravel, which finally supported controllers, ioc principles, and a blade templating system that permits the developers to better integrate php with the view.
laravel 3 was released in february 2012 and, in a certain wa,y it could be considered a small breakthrough.
tthe main features are: artisan, a brand new cli (command line interface), plus database migration, events handling and bundles, and a packaging system.
in may 2013, mr. otwell released illuminate, the nickname chosen for laravel 4.
after so many successful years, it was completely rewritten and distributed as a package via composer.
with the fourth version of laravel, developers could really certify that the project was now growing at the point to be world class.
among its new features, i'd like to highlight database seeding, which allows for the populating of databases, support for different kinds of emails, soft deletion, and message queueing. not to mention the publication of a release scheduled for the minor version.
basically, from this version on, there will be a new minor version every six months or so.
laravel 5 made its appearance in march 2015. this version includes flysystem for remote storage, elixir to handle package assets, socialite for authentication, and scheduler for... guess what? scheduling tasks!
at this point, laravel was already the most popular php framework.
the first version with long-term support (lts) was laravel 5.1. the plan, then brought in again with version 5.5, was to support security and bug fixes respectively for two or three years.
at the point of writing this article, laravel is on version 5.6 , which was officially been released on february 7, 2018.
besides the unbelievable high quality and hard work from the creator and the contributors, i think that laravel changed how web developers write and think about their job.
for example, using a feature like eloquent orm (active record) presenting database tables as classes makes the developing process, thus the life of developers, so much easier.
attending laracon in either the us or europe is something that most developer have dreamed of at least once.
laravel news will keep you and your colleagues informed about what is happening around this framework, and last, but not the least, laracasts with thousands and thousands of minutes of free videos edited by jeffrey way, an incredible developer former top-mind at envato tuts+.
as you can se,e choosing laravel means choosing the entire ecosystem.
join a huge community of developers tha,t even if you do not realize it, will make your job better in the years to come.
to be continued...
now it's your turn
i hope you enjoyed my framework comparison.
the next part will be published soon.
but now, i want to hear from you:
which php framework has intrigued you the most? are you going to try one of these listed above?
Published at DZone with permission of Nico Anastasio. See the original article here.
Opinions expressed by DZone contributors are their own.