Forms in Symfony framework. Data from multiple tables. (Lesson 13. Forms. Continued)

In the previous lesson, we learned how to create simple forms in Symfony framework that contain (and modify if necessary) data from tables. As you remember, we used models (entities) of these tables.

But in practice, we have to solve more complex tasks. For example, displaying/modifying data from multiple tables in Symfony framework.

A rough example - one table contains articles, and there is a field that sets the section id (which has a separate table). We need to make it possible to conveniently select a section for an article. Fortunately, this is a routine task for Symfony framework. =)

Working with forms in Symfony framework (Lesson 12. Forms. Introduction)

In this note we will learn how to create and handle forms in Symfony framework.

Forms can be created "from scratch" or using an ORM (object-relational mapping) to generate forms based on database tables. Let's start by exploring the second option. In practice, these types of forms are most commonly encountered since in most cases, the data entered in the form needs to be stored somewhere (in a database).

Placement of a project on the Symfony framework on the server

As you know from the lessons, the public directory of Symfony framework by default is web/, and the framework directories lie next to it. This means that for normal operation and pretty URLs, the DocumentRoot on the server should be set specifically to the web/ folder. But this is not always convenient and not always possible on hosting. In most cases, you will not have the ability to edit the DocumentRoot.

Using templates in Symfony framework. (Lesson 7. Twig)

Using templates in Symfony framework can be done in several ways. First, you can use PHP templates. But the preferred option is to use the Twig template engine (by default). Twig is a compiling open-source template engine written in PHP. It produces PHP/HTML code as output. Besides being very functional, Twig is also very fast.

Routing in the Symfony framework (Lesson 6: Routing)

After learning how to create controllers (here), it is important to understand how a user can invoke a controller and how to work with it.

The Symfony framework has a special feature called routing system. In yii framework , for example, routing is determined by the file structure of the application by default (although you can still use a routing system with the necessary tools). However, in Symfony framework, you have to define the routing manually (excluding the basic routing created by the bundle generator).

Creating and deleting bundles in Symfony (Lesson 4)

So, after studying the materials 1, 2, 3, it's time to start developing your first Symfony application =). So, as you already know, everything in Symfony is a bundle. And, as you remember, the place for bundles is the src/ directory.

Installation of Symfony 2.* (Lesson 2. Preparation)

So ... We have already familiarized ourselves with Symfony framework (here) and gained the courage to install it. Symfony installation can be done in two ways. The first one is manual - download the archive from the official website (http://symfony.com/, just in case =)) All according to the standard - download, unpack to the web server directory, use.