What’s Web application framework Symfony 4 hot

Symfony is a widely used PHP framework for building large-scale web applications , and its library is also used as a platform for many systems such as Magento 2, Drupal 8, phpBB … Projects. famous project using Symfony . 

It is easy to see that Symfony is the most powerful and standardized library available today. If you are a follower of PHP, then it is missing when you have never heard of that name. 
I am not afraid to announce that a fan of Symfony is currently eating with Magento. Previously, I used Symfony2, but later switched to many other technologies, but I still love this framework because of its scientific scientific structure. So far 6 years (2012-2018) Symfony has been up to version 4, on the occasion of re-understanding “old love”, I wrote this article to describe more about Symfony for you to learn and introduce https://dienmayphatdat.vn/ is one of websites using Symfony Framework. New features, new principles in Symfony4 .

The symfony is a web application framework written in PHP language, and it’s free. Unlike other types of frameworks such as Zend or CodeIgniter that build their own libraries, Symfony includes many components, different libraries combined into one system, complete application . This is similar to the sentence “1 hand does not work, 4 hands are bunched up into a casino”, so instead of 1 company building 100% of applications, Symfony will integrate the essence of 10 companies to make 10% of my application. That is the origin of the name Symfony – Symphony means “symphony”, as a symphony orchestra with countless instruments, artists and concerts to create melodious melody.

“Symfony is a set of PHP Components, a Web Application framework, a Philosophy, and a Community – all working together in harmony. »

Is that a mess? 
The combination of the most advanced technology is probably not the best, for example, your house has all luxurious furniture, genuine TV, big fridge … But messy arrangement only takes up space and you will crazy if you live in a house like that: 

Of course that doesn’t happen in Symfony, SF’s ingenious designers cleverly handed the initiative to users, first when installing SF will be the simplest version, after which you want to add features. , you install component for that function, operation, Symfony library loading all. 
For example: 
To use the language translation feature for the website you need the translation library, then you will run the command:

firstcomposer require symfony/translation

Then you define the default language in the configuration file: config/packages/translation.yaml 
And write translation text in: translations/messages.vi.yaml

How many components are in Symfony?
There are about 50 components for Symfony, each with its own unique function and high reuse. Symfony components include code and documents . You can even use them completely independently from Symfony Framework, thanks to this liberal nature, other frameworks can easily “pregnant” with Symfony, such as Magento2, Laravel, Yii, CakePHP … That is to use. component built by Symfony in its core.

You can do anything with Symfony
Actually Symfony is very “Imba”, unlike traditional Library Frameworks, the Symfony community today has built many platforms that meet all the complex business needs of Product Information Management ( Akeneo PIM ), Content Management System ( eZ Platform CMS , CMF ), Customer Relationship Management ( ORO CRM ), eCommerce ( Sylius eCommerce ) … And can you believe it? The whole thing is Open source – it’s free! Software is like sex: it’s better when it’s free.

Best practices

Bundle-less architecture

Previously, Symfony encouraged programmers to organize applications into bundles, ie specialized code blocks (modules), such as FrontendBundle for Frontend for customer and client, BackendBundle for admin and manager.CMSBundle and EcommerceBundle for 2 content management and e-commerce features … 
But from version 4 Symfony encouraged to remove all bundles, all written inside a single folder is src/ 

The reason Symfony wants to simplify the application. There are schools in web application architecture, 1 is micro-applications or micro-services application subdivision, 2 is monolith 1 architecture. Of course, any architecture has its advantages and disadvantages, depending on the size of the application for you to choose. Fortunately, Symfony claims to support both types of architectures, although actually the most accurate version of Symfony is suitable for one-block type, your code using component symfony is located in the vendor, module subdivision and resolution. The problem depends on each other, the relationships between them only make you more troublesome, make it simple .

Symfony Applications go minimal

At the time of version 2, Symfony was famous as alcohol because of its superior strength to smash the stains … Well, I was mistaken through washing powder. Generally very strong, but one drawback is that it is too strong, so it is heavy, not suitable for small applications. But for a long time, with Symfony 4, your vendor was streamlined to the maximum to implement a basic web application. 
When you need some functionality in components, run the composer require command, then Symfony will download and configure it for you to use immediately, Symfony calls it developer experience .

10 famous PHP framework for programmers

PHP is now known as one of the most popular server-side programming languages ​​in the world. Well-known programmers love to use PHP frameworks because they help accelerate product development, easily providing you with good reusable code structure. Avoid giving users concerns about security levels.Promote web development like object-oriented programming tools. The following are 10 PHP frameworks used for most popular PHP programming .

10 famous PHP framework for programmers

1. Laravel

PHP programming

Released in 2011, Laravel helps you deploy applications more quickly. Laravel provides video tutorials on its site called Laracasts. Its basic features include: allowing users to integrate Blade Templating Engine – this is a templating framework similar to the way the Smart Templating Engine works. Through the use of custom tags and functions for better code separation. Besides, it also contains another local development environment called Homestead. This is considered a Vgrant box.

2. Symfony

PHP programming

The framework is often used in large, suitable projects when working on teamwork. Examples are administering Drupal content or software for phpBB forums. Symfony framework currently has an extremely large and enthusiastic community in Vietnam. It is currently being evaluated as one of the best PHP frameworks today.

Symfony contains many libraries that allow you to complete various tasks easily. For example, authentication, template making, form creation, etc. Symfony has the ability to help you limit your code time to the lowest possible level.

3. CodeIgniter

PHP programming

The outstanding feature is compact, still runs smoothly despite being launched in 2006. The installation process is simple and usually does not require high configuration. A great way to help you save costs.This is a framework that can run on many types of hosting without high configuration requirements. You will also avoid the trouble of having conflicts between PHP programming versions with CodeIgniter

You have to use Controller classes but for Models and Views you have the right to use it to choose your own name. Besides, CodeIgniter framework is extremely suitable for the operation of Smarty Templating Engine.

4. Yii 2

PHP programming

PHP framework suitable for use in projects. You will feel your website is loaded faster when using other frameworks. Besides the accompanying utilities, update, create and read (CRUD).

Yii2 is a model for object-oriented programming. So it supports your code a lot more logically and neatly.

You can easily integrate jQuery libraries . A great framework for PHP programmers.

5. Phalcon

PHP programming

Launched in 2012 and fast to gain a foothold in PHP frameworks. Speed ​​of code execution is very fast due to programming in C and C ++ . If you don’t learn C language, you can still use it easily because it has been built into PHP classes, so you can easily use it at any time. Besides the acceleration function, it also helps to reduce resources and many interesting features such as security, translation, caching.

6. CakePHP

PHP programming

Appeared in 2005 but still being used in a very popular way. CakePHP is always updated and upgraded on a regular basis. The latest version is 3.3 to enhance the management, improve the speed of modules and especially increase the ability to create independent libraries.

Sites like BMW, Hyundai and Expres use CakePHP when designing websites . This framework has extremely high security when integrated with SQL ejection, XSS prevention, CSRF protection …

7. Zend Framework

PHP programming

Is an open source and extremely stable. Zend Framework is extremely complicated for you to learn or have no background about MVC. It is seldom used in small projects but is a great framework for large projects with high complexity.

As a major partner of IBM, Google, Microsoft, and Adobe. Zend currently supports interesting features such as a drag-and-drop editor, front-end programming support, online debugging capabilities. Created by Agile method , Zend Framework is capable of providing the most quality applications for consumers.

8. Slim

PHP programming

Is a micro framework capable of providing everything you need. Slim has a minimalist design that is suitable for small applications

Slim is used by PHP programmers to create RESTful APIs and services. Other features include: HTTP client-side caching, encryption and cookies. Slim is quite easy to understand and easy to use for sure you should experience.

9. FuelPHP

PHP programming

As a framework with fat source code is provided in a free and flexible way. Direct support for MVC and integration of some other optional layers called Presenter makes the View and Controller always logical.

FuelPHP has an extended module that increases security for the website thanks to URI filtering and early coding capabilities.

10. PHPixie

PHP programming

Launched in 2012 is a completely new open source framework. PHPixie was created to increase productivity for read-only websites. Designed with HMVC model, you can search documents and instructions through the official website.

Some features of PHPixie include: input validation, caching, standard ORM. It also allows you to use languages ​​like HAML markup.