A Guide to Popular PHP Frameworks for Beginners


As a PHP developer with many years of experience, I have worked with several different frameworks. Recently, I came up with the idea to write an article for beginners who want to start learning PHP. Below is the overview of the most popular frameworks, based on my personal experience.

For comparison, the following frameworks have been selected: Yii, LaravelSymfonyZend, CakePHP, CodeIgniter.

The frameworks have been compared according to the following criteria:

  • Simplicity and installation of the framework
  • Documentation
  • Flexibility
  • PSR compatibility
  • Project applications

Yii

Yii 2 is a high-performance PHP framework which enables you to quickly develop a program. This framework can design small, medium, and large projects such as blogs, corporate websites, online shops, portals, CMS systems, RESTful programs, etc.

  • Like most PHP frameworks, Yii uses the MVC (Model-View-Controller) pattern.
  • Yii is a full-stack framework which includes a large number of ready-made and tested tools, systems, and codes for ActiveRecord SQL and NoSQL database systems, RESTful API, multi-level caching support, and more.
  • Yii is easy to upgrade. You can write your own modules or extensions and extend the framework’s functionality.
  • One of the distinguishing features of this framework is its high performance, although Yii is quite a massive framework.
  • This framework has a code generation module called Gii, which speeds up project development.

Installation

To use Yii2 in your computer, you will need to have a 5.4 or higher version of the PHP programming language installed. You can install this framework via composer.

The Framework enables two types of program frame: basic and advanced. You must choose which version you need upon your installation.

Documentation – This framework has a fairly simple instruction manual.

Flexibility – This framework allows extending its functionality. New modules and plug-ins can be installed via composer. You can also create your own extensions.

PSR – This framework meets the second version of PSR standards, PSR-2.

Where can this framework be used? This framework can be used in any project — from simple web programs to RESTful programs, extensive portals, CMS systems, and others.

Laravel

Laravel is a framework that allows for beautiful code writing. Laravel will help you facilitate a number of operations such as registration, routing, caching, and working with sessions. With Laravel, the best features of other PHP frameworks and Ruby on Rails were taken into consideration.

Laravel is a simple yet powerful and flexible tool for creating large projects, even for beginners.

  • It has a magnificent IoC
  • Simple and convenient migration system
  • Modular testing system

Installation

To use Laravel, you will need to have PHP 5.5.9 or higher installed. You can install this framework via composer and Laravel Installer.

The installation is simple and fast. After the installation, you will receive the skeleton code to build up your project.

Documentation – This framework has fairly simple and accessible guidelines.

Flexibility – This framework allows extending its functionality. New modules and plug-ins can be installed via composer.

PSR – This framework meets the second version of PSR standards, PSR-2.

Where can this framework be used?  This framework is an optimal choice for creating small and medium-sized projects. However, it can also be used to develop large-scale websites.

Symfony

Just like Yii, Symfony is a full-stack framework which can be used to create any project. This framework is quite large and rather complicated for beginners. Symfony is a framework with functionalities according to modern requirements. It is used in particularly expansive projects. Drupal CMS is also based on the Symfony framework.

Installation

To use Symfony 2 on your computer, you will need to have PHP 5.4 or higher installed. You can install this framework via composer and Symfony Installer.

The installation of the framework is quite simple. While installing Symfony, you have the chance to choose your future type of program and the corresponding structure will be created based on your choice. You also have the option to choose one of the following four frames:

  1. Standard Edition is installed by default
  2. Hello World Edition is designed for producing benchmarks
  3. Symfony CMF Standard Edition is suitable for producing CMSs
  4. Symfony REST Edition has the required REST- functionality

Documentation– The instructions of this framework seemed more complicated to me, compared to the ones of Yii 2 and Laravel frameworks.

Flexibility – This framework allows you to extend its functionality. New modules and plug-ins can be installed via composer. You can also create your own extensions.

PSR–This framework meets the second version of PSR standards, PSR-2.

Where can this framework be used? This framework can be used in any project: starting from simple web programs to RESTful programs, extensive portals, CMS systems, and others.

framework.zend

Zend Framework 2 is a free PHP framework created by Zend developers. The company is currently engaged in the development of PHP programming language. This framework has a lot of functionality and can also be used for academic code writing. Zend is a MVC / OOP (Object-oriented Programming) framework, which is used in massive projects.

Installation – This framework can be installed via Composer. A ready structure of the program can be taken from Zend skeleton application.

Documentation – This framework has rather simple and comprehensive instructions.

Flexibility – This framework allows extending its functionality. New modules and plug-ins can be installed via composer.

PSR – The second version of this framework complies with PSR-2.

Note: The second version of Zend framework operates quite slowly and requires more effort to complete a project. Since it is an academic framework, all rules to develop a program are maintained. This framework is not for beginners.

Where can this framework be used? This framework can be used mainly for large-scale projects.

CakePHP

CakePHP 3  is a free PHP framework which includes ready codes to develop a program quickly. MVC template is available in this framework. CakePHP is an OOP framework, which has quite a lot of functionality, operates fast, and has great efficiency.

Installation–To use CakePHP, you may need to have PHP 5.5.9 or higher. You can install this framework via composer. After the installation, you get a ready structure and can build your web app based on it. The installation is usually simple and fast.

Documentation – This framework has rather simple and comprehensive instruction manual.

Flexibility – This framework allows you to extend its functionality. New modules and plug-ins can be installed via composer.

PSR compatibility – The third version of this framework matches PSR-2.

Note: The latest version of CakePHP, CakePHP 3 is rather flexible and has greater efficiency than the preceding one.

Where can this framework be used? This framework can be used for almost any project, starting from simple web-programs to REST programs and portals.

CodeIgniter

CodeIgniter is also free of charge and an open source framework. However, this framework is not designed for large projects. This framework, while one of the fastest, is considered to be dying out since new versions and functionality are rarely released.

The MVC template is also accessible in this framework. CodeIgniter allows you to work with multiple databases such as MySQL, PostgreSQL, Oracle, and more. It has clear and comprehensive instructions. Moreover, it takes less time to develop a program in this framework.

For beginners, I recommend this framework as a starting PHP framework to facilitate the study process.

Installation– In order to install this framework you will need to upload and de-archive the framework files. The framework does not enable installation via composer yet.

Documentation– The instructions of this framework are not so simple. It takes twice longer compared to all the other frameworks to find the necessary sections.

Flexibility – This framework does not allow for extending functionality with current technology.

PSRNot compatible with PSR standards.

Note: This is a simple framework that operates fast. However, I believe it is dying out.

Where can this framework be used?–I don’t advise to use this framework for commercial purposes, only for facilitating study.

The Speed, Efficiency, and Resource-Saving of Frameworks

Testing was carried out with these six frameworks on the same computer and taking the same actions. Apache Benchmark was set as a testing tool. The computer where the testing was performed has the following specs: Intel Core i5, 8GB DDR3, SSD SATA3, Ubuntu 14.04 LTS, Apache 2.4, PHP 5.5.

The number of requests these compared frameworks could handle per second

Frameworks Test Results

Which framework is worth studying?

Two of the frameworks, CodeIgniter and CakePHP, are slow and CodeIgniter is not in compliance with the current requirements. Thus, these tools are not worth learning at this point.

Yii2, Laravel, Zend, and Symfony are currently in compliance with modern standards and requirements. They are in demand and have enormous functionality. To study these three frameworks, you need to know what MVC means, have a profound knowledge of PHP, including OOP, and be capable of working with databases. For beginners, it will be easier to start with Laravel and Yii, rather than Symfony or Zend.

 

Featured Image: Search Engine Journal

In-Post Photo: Screenshots taken by V. Petrosyan

Subscribe to SEJ

Get our daily newsletter from SEJ’s Founder Loren Baker about the latest news in the industry!





Source link

?
WP Twitter Auto Publish Powered By : XYZScripts.com