Skip to content

Commit e2caa7f

Browse files
zairigimadxabbuh
authored andcommitted
Update command in controller
Add example of passing argument beside option to console command from contoller
1 parent e7fbb60 commit e2caa7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

console/command_in_controller.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ Run this command from inside your controller via::
4040
$kernel = $this->get('kernel');
4141
$application = new Application($kernel);
4242
$application->setAutoExit(false);
43-
43+
// if your command define an argument (example: fooArgument)
44+
// you can pass it in the array under ArrayInput
4445
$input = new ArrayInput(array(
4546
'command' => 'swiftmailer:spool:send',
4647
'--message-limit' => $messages,
48+
'fooArgument' => 'barValue',
4749
));
4850
// You can use NullOutput() if you don't need the output
4951
$output = new BufferedOutput();

0 commit comments

Comments
 (0)