symfony

Symfony form pills – form type options

Today we are going to tackle a problem that I’ve recently faced with Symfony form types. Scenario: I need a choice type of a certain entity (Foo) with values that follows a certain logic

I’ve built up a FooChoiceType because I don’t want to inject fooAdapter in each form where I’m…

Symfony form pills – Value object

Suppose that we have a value object or, more in general, an object where its data has been set in the constructor

and its FormType

Let’s assume that bar and foobar are taken from HTTP POST values (so, basically, we need those values to be posted in order to instantiate a Foo object). Question How can I create…

Assets versioning with Symfony and Capifony

Just a quick tip for assets versioning with Symfony2. Let’s imagine you have an asset, called “beautifulAsset.js”, in your app. As soon as it’s requested, the user browser caches it. So far so good. Problems arise when you change the code inside “beautifulAsset.js” and deploy your application. If you don’t…