As already discussed, learning Symfony is to learn installing and using powerful tools. I have introduced you to one of such tools, called Twig. In this article, I will cover more about twig and benefits of using such template engine. Unless you are building an API, twig will help you to deal with templates a lot easier.
Twig is a modern template engine for PHP
In the previous article, I have already covered what Route and a Controller is, and how to use them inside Symfony.
As I already explained, the Controller is a function we write to handle request that comes into a Symfony and return a response. As a response you can render a template or even turn objects into JSON for an API.
To create your first page with Symfony, you first need to understand what Route and a Controller is.
Symfony embraces the HTTP Request-Response lifecycle.
The Route is basically a map from a URL path to a controller and it can be configured in 4 different ways: using annotations or configuring route inside YAML , XML and PHP file.
Every framework has its own directory structure. Some of them may be similar to other ones. For example, Laravel looks similar to Symfony, since it’s based on Symfony framework, but on the other hand, CodeIgniter does not look similar to any of the two I mention above.
Frameworks are a powerful tool for quickly building web applications. Learning how to use frameworks will help you to build your projects better and faster. One of the most popular PHP frameworks is called Symfony, which is known to be the hardest to learn from all others PHP frameworks.
While working as a developer, whether you’ve just started or been working for years, it’s highly likely that you’ve met the term docker.
If you have been working with a docker for years, then you know all its advantages and disadvantages. In case you’ve just started, keep reading, as this might help you out to start with docker and introduce yourself with a whole new way of developing your web applications.