Defining Symfony 2 controllers in two ways

If you start with Symfony 2 using the quick tour, you might assume there is only one way of creating a controller: by extending Symfony\Bundle\FrameworkBundle\Controller\Controller. If you follow the more in depth book you might notice a tip to a second way of creating a controller: as a service. Lately I’ve been exclusively creating my […]

Validation annotations in Symfony2

The Symfony2 form component has a very nice way of validating: using annotations. These validation annotations give you the ability to annotate one or more invariants in the documentation of the properties of your class. These are automatically read and validated! Talking about up-to-date documentation. You can describe invariants like this in your entities: Since […]

Merging arrays in PHP

A short story about merging arrays in PHP. When merging two arrays you’ll probably look at array_merge first. These two sentences in the docs say the following: If the input arrays have the same string keys, then the later value for that key will overwrite the previous one. Values in the input array with numeric […]

Symfony 2 schedule

After I got back from my holiday in London, I was catching up on my RSS feeds. I was happy to see that Fabien has posted an update for the Symfony 2 schedule. At my work, we’re looking for a bit of stability, so having a schema and predictability is good news. In this Symfony 2 […]