Skip to content

Tag: symfony

Symfony2 generate controller inside custom folder

Symfony2 has a command for generating controllers http://symfony.com/doc/current/bundles/SensioGeneratorBundle/commands/generate_controller.html Command’s default behavior is to generate the given controller inside controller folder within the bundle. Is it possible to customize the folder where the con…

Getting array keys in Twig? (Symfony)

Is it possible to get the key of an array in Twig (in Symfony)? For example if I have an array of: Is it possible in Twig to print: key1: value1 key2: value2 Thanks Answer Try following format: More Information on Offical Twig about Iterating over Keys and Values https://twig.symfony.com/doc/3.x/tags/for.html…

Symfony Console tab completion

I have an application with a Symfony Console based CLI. The application does not use the Symfony framework, just the Symfony Console component. When I execute I get the usual overview with the name, version, options and registered commands shown. Suppose I just have one command, called “displaykittens&#…