Multiple entities in one Symfony 2 form

Case: User belongs to Account entity and in registration form I want to create Account for him.

First I have simple registration form from FOSUserBundle. To extend it you have to create new form type which contains fields from other entity. In my example I have only name required to create new Account.

Truncate filter in Symfony 2

Fabien Potencier created very useful filter for truncating strings to given number of chars. It’s included in Symfony Standard Edition, but not enabled by default. To fix this place this in any of your service-config files. (more…)