fbpx

Categoria Symfony

Lightweight controllers everywhere in Symfony

The usual way of defining a controller in a default Symfony installation is by placing it in the src/Controller directory, but there might be situations where you just don’t want to do that. For instance, if you’re using some sort…

TWIG: include VS embed VS macro

There are various types of code reuse in Twig but, what are the differences between them? In this article we’ll explore the differences between include, embed and macro. First of all, some definitions from the documentation: The include statement includes…

Come rendere fault-tolerant SncRedisBundle

Capita di voler utilizzare Redis per memorizzare informazioni non fondamentali o che possono essere rigenerate anche nel caso non fossero accessibili.In questi casi se il server Redis dovesse non essere disponibile per un qualsiasi problema, il nostro servizio sarebbe completamente…

Doctrine EntityListener Pills: Comparing old and new values when updating data

You all, at some point, faced the necessity to compare old and new values when storing an entity. Here is where Doctrine EntityListener comes at help. Let imagine you have this User entity

and you want to notify the…