Skip to content
Advertisement

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 controller will be generated ( controller/backend for example ) ? Answer You can get all the available options of this command with the help command: No you can’t

Access Command OutputInterface within a Doctrine Fixtures Load

I’m generating a huge amount of data fixtures using the awesome Faker Library, also using lorempixel.com to have some random images in my Symfony2 project. This takes some time (currently ~ 10 Minutes), so I was wondering if it is possible to access the Command OutputInterface somehow through the container interface and print the progress this way instead of echo’ing

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#iterating-over-keys-and-values

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”. What I want to be able to do is And have it

Advertisement