#symfony

6 posts in this collection

6 Rules of thumb to build blazing fast web server applications

In this post I will try to highlight some of the most common principles that you have to take under consideration when you want to achieve a great level of performance while building a web application (specifically on the backend part). I believe the concepts discussed here can be applied to any language and framework even if, due to my specific experience, I will mention some examples, design patterns, conventions and tools that are mostly used in the PHP world. You can read this article in other languages…

Symfony, edit the Response globally using the Kernel Response event

One of the things I like most of the Symfony framework is its Http Kernel component . Not only it does offer a very straightforward abstraction to handle requests and responses in an object-oriented way but it also allows you to interact with the whole response generation process through events . This approach is very convenient and flexible and in fact the Http Kernel component is the foundation of the Symfony framework but also of several other famous frameworks (Silex, Laravel) and CMSes (Drupal…

Transparent pixel response with Symfony, how to track email opening

If you have ever heard about ” transparent pixel ”, ” 1x1 blank pixel ”, ” tracking pixel ” or simply ” tracking image ” you probably know what we are going to talk about and can just skip to the implementation ! Introduction Transparent pixel image is a technique often used to track some user behavior (often visits or views to a certain online content) in scenarios where you can’t use javascript. One of the most common scenarios is probably email opening tracking. Can you put Google Analytics into an…

Write a console application using Symfony and Pimple

In this article I will show you how to set up a stand alone command line application by using the Symfony Console component and Pimple . Writing console commands for Symfony (full stack framework) is easy and enjoyable. It helps a lot when you need to handle particular collateral tasks that are needed, in a way or another, to make your website running (processing and crunching data, make async requests, create reports, etc.). Anyway I discovered that writing stand alone command line applications using…

Integrating Twig.js and BazingaJsTranslationBundle

Recently I had the need to run a twig template that uses the filter on my frontend using twig.js , a pure JavaScript port of twig written by the good Johannes Schmitt . The JavaScript version does not handle all the functionalities offered by the original PHP version (even if it goes pretty close) and in particular it does not natively handle the filter. So, at first, I got a JavaScript runtime exception on my page when trying to use the template. Luckily enough the JavaScript version of twig is…

Symfony security: authentication made simple (well, maybe!)

The Symfony2 security component has the fame of being one of the most complex in the framework. I tend to believe that’s partially true, not because the component is really that complex, but because there are (really) a lot of concepts involved and it may be difficult to understand them all at once and have a clear vision as a whole. I am in the process of writing an OAuth bundle and I faced the need to deeply understand how the authentication process work in Symfony2 to being able to integrate the…