Symfony

Quelle est la méthode la plus couramment utilisée pour contrôler les fonctionnalités de Symfony ?

Symfony est un framework open source pour le développement d’applications Web et d’API. Il permet aux développeurs de créer des applications Web riches et puissantes et de les déployer rapidement. Il est conçu pour être facile à apprendre et à utiliser, et fournit un grand nombre d’outils et de bibliothèques pour le développement. Avec Symfony, …

Quelle est la méthode la plus couramment utilisée pour contrôler les fonctionnalités de Symfony ? Lire la suite »

jQuery, Webpack and Symfony | Call jQuery in your twig files

Uncaught ReferenceError: jQuery is not defined If you encountered this error message in your console of a Symfony project using Webpack, it is very likely that you are using jQuery in the following way in your project :  Your case In the app.js file you probably called jQuery like this : And then you wanted to call in your twig jQuery file this way …

jQuery, Webpack and Symfony | Call jQuery in your twig files Lire la suite »

Symfony, Doctrine | Retrieve old data of FormType

Method for recovering old data from a FormType under Symfony You need to recover old data from an Entity in Symfony to do some processing such as managing a history or other? I will present you a method that uses Unit Of Work to compare old data of data sent via the form created by FormType. Use Unit Of Work from Doctrine To retrieve old data it is …

Symfony, Doctrine | Retrieve old data of FormType Lire la suite »

Doctrine, Symfony | Difference between two dates in MySQL (Day, month, year…)

How do I know the difference between two dates in MySQL and Doctrine? You have to use the TimeStampDiff method which takes 3 parameters (the unit, the first date, the second date) and returns a number corresponding to the difference in unit between the dates. For example:  See more details on this link which explains in detail the SQL function TIMESTAMPDIFF How to …

Doctrine, Symfony | Difference between two dates in MySQL (Day, month, year…) Lire la suite »

Symfony FormType Choice | Set data default to group of radio button

How to set a default value to a ChoiceType radio button group under Symfony 4+? Currently you probably use the forms this way: This gives you as a result a group of 3 radio buttons with only one possible choice, but if you put directly here a default value, it will overwrite the values of the entity if you want to change it afterwards. …

Symfony FormType Choice | Set data default to group of radio button Lire la suite »

Symfony, Excel, CSV | Generating a CSV file for Excel with Symfony

It’s a common practice on web applications to extract data via CSV, whether it’s to retrieve statistics or to make data backups, I’ll show you how this is easily done with Symfony via a Controller. How to generate the CSV file with a Symfony Controller To generate the file, it must be constructed as in the following example, by defining the columns of the CSV file with …

Symfony, Excel, CSV | Generating a CSV file for Excel with Symfony Lire la suite »