When asking people if they use Symfony’s autowiring functionality, an often heard excuse why people don’t use it is because of all the magic that is happening during autowiring. But just like most impressive magic tricks, once explained, it all boils down to a few simple principles and Symfony’s autowiring is nothing different in that perspective. In this blogpost I will explain the new autowiring and autoconfiguration features, and why you should love them.
Don’t you hate it when you are stepping through your debugger during a Symfony application debug
session, and all of a sudden it cannot find files anymore as Symfony uses code located in the
bootstrap.php.cache
instead of the actual Symfony component. Symfony creates these cache-classes
in order to speed up execution, but it makes that xdebug cannot find the correct code to step
through anymore.
If you know Symfony2, you probably are using (or at least, have heard of) the @paramConverter annotation from the SensioFrameworkExtraBundle. This is a really simple way to convert slugs into entities. But lots of times I find myself having multiple slugs inside my routes, and this is something the @paramConverter annotation cannot do. So that’s why I’ve created the multiParamConverter.