@@ -20,11 +20,9 @@ Instead, you can run the command directly from the controller.
2020 a controller has a slight performance impact because of the request stack
2121 overhead.
2222
23- Imagine you want to send spooled Swift Mailer messages by
24- :doc: `using the swiftmailer:spool:send command </email >`.
25- Run this command from inside your controller via::
23+ Imagine you want to run the ``debug:twig `` from inside your controller::
2624
27- // src/Controller/SpoolController .php
25+ // src/Controller/DebugTwigController .php
2826 namespace App\Controller;
2927
3028 use Symfony\Bundle\FrameworkBundle\Console\Application;
@@ -34,19 +32,19 @@ Run this command from inside your controller via::
3432 use Symfony\Component\HttpFoundation\Response;
3533 use Symfony\Component\HttpKernel\KernelInterface;
3634
37- class SpoolController extends AbstractController
35+ class DebugTwigController extends AbstractController
3836 {
39- public function sendSpool(int $messages = 10, KernelInterface $kernel): Response
37+ public function debugTwig( KernelInterface $kernel): Response
4038 {
4139 $application = new Application($kernel);
4240 $application->setAutoExit(false);
4341
4442 $input = new ArrayInput([
45- 'command' => 'swiftmailer:spool:send ',
43+ 'command' => 'debug:twig ',
4644 // (optional) define the value of command arguments
4745 'fooArgument' => 'barValue',
4846 // (optional) pass options to the command
49- '--message-limit ' => $messages ,
47+ '--bar ' => 'fooValue' ,
5048 ]);
5149
5250 // You can use NullOutput() if you don't need the output
@@ -76,7 +74,7 @@ First, require the package:
7674
7775 Now, use it in your controller::
7876
79- // src/Controller/SpoolController .php
77+ // src/Controller/DebugTwigController .php
8078 namespace App\Controller;
8179
8280 use SensioLabs\AnsiConverter\AnsiToHtmlConverter;
@@ -85,7 +83,7 @@ Now, use it in your controller::
8583 use Symfony\Component\HttpFoundation\Response;
8684 // ...
8785
88- class SpoolController extends AbstractController
86+ class DebugTwigController extends AbstractController
8987 {
9088 public function sendSpool(int $messages = 10): Response
9189 {
0 commit comments