Sometimes a single idea can change everything about programming. For me, one of those ideas was the concept of a service container. It's like the holy grail). Actually, the idea itself is not specific to Symfony framework, it's just one of the successful patterns of application design often used in Symfony.
Aside from the standard Symfony distribution, there are many bundles from third-party developers that greatly simplify application development (after all, why reinvent the wheel when there is a ready-made solution available). Let's not get into a debate about the often presence of functionality in bundles that will never be used in your application—development speed will cover these fairly minor issues. Here is a modest collection of bundles that greatly simplify life.
To install a bundle, first add it to your project using composer, for example:
composer require "presta/sitemap-bundle:~1.4"
Composer - a dependency manager, or rather, a package manager for php.
Official website: https://getcomposer.org/
Allows you to keep track of components used in a php application, install them, update them, etc.
Right after starting to work with Doctrine I acquired some prejudices. I have since eradicated them, but maybe someone still has them, maybe this note will help someone =)
It's time to deal with Wordpress. Personally, I've been using it for quite a while, but only as a user/administrator, with a little half-intuitive tweaking of some missing functionality for me personally. But now it's time to go deeper.
A few notes back I considered working with assets in the Symfony framework. This example shows how to work with your own assets. But in practice, it is often necessary to use external assets.
For such, and not only such tasks, assetic is suitable. It is quite difficult to describe in a few words what it is. But I imagine assetic as an asset manager for myself.
In the previous note, we familiarized ourselves with the deprecated mysql module. Here we will provide an example of working with a more modern one.
If before (before php 5.0) it was possible to use a more or less trivial way of working with databases in php (using the MySQL module), then with new versions of php it is necessary to switch to new modules, such as mysqli or pdo. The MySQL module is deprecated in php 5.5.x and will soon be completely excluded.
In this note we will remind you how to use the MySQL module, but use modern interfaces for work (see the next notes). To use the minimum functionality of the MySQL module you only need to remember a few functions (of course, there are many more of them, here only the necessary minimum is presented).
As of 2012, there were 612,843,429 websites on the Internet. This number is rapidly growing.
So why do people create websites?
So, in this note we will learn how to restrict access to sections of a website written using Symfony framework. Symfony framework provides powerful tools for access control, which allow you to restrict access both by url and entire controllers.
Quite an important task in the development of websites and web applications is restricting access to certain sections of the site, such as the admin panel. In theory, this is a rather complex process, consisting of three components - authentication, identification, and authorization.
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. =)
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).
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.